Files
Game_Calendar_BE/Dockerfile
Harun CAN 8674911033
All checks were successful
CI / build (push) Successful in 2m23s
main
2026-01-30 02:52:42 +03:00

50 lines
780 B
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Generate Prisma client
RUN npx prisma generate
# Build the application
RUN npm run build
# Production stage
FROM node:20-alpine AS production
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --only=production
# Copy Prisma schema and generate client
COPY prisma ./prisma
RUN npx prisma generate
# Copy built application
COPY --from=builder /app/dist ./dist
# Copy i18n files
COPY --from=builder /app/src/i18n ./dist/i18n
# Set environment
ENV NODE_ENV=production
# Expose port
EXPOSE 3000
# Start the application
CMD ["node", "dist/main.js"]