initial commit

This commit is contained in:
Shrev Dev
2025-10-11 00:16:00 -05:00
commit 9f69b43704
21 changed files with 3292 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY tsconfig.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY src ./src
# Build TypeScript
RUN npm run build
# Production stage
FROM node:20-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --only=production && \
npm cache clean --force
# Copy built application
COPY --from=builder /app/dist ./dist
# Create non-root user
RUN addgroup -g 1001 -S appuser && \
adduser -u 1001 -S appuser -G appuser
# Change ownership
RUN chown -R appuser:appuser /app
# Switch to non-root user
USER appuser
# Start the application
CMD ["node", "dist/index.js"]