Files
skript-be-v2/Dockerfile
Fahri Can Seçer 2cb5b25341
All checks were successful
CI / build (push) Successful in 1m5s
Deploy Backend / build-and-deploy (push) Successful in 7s
Update Dockerfile
2026-02-07 00:43:44 +03:00

52 lines
860 B
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN apk add --no-cache python3 make g++
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 apk add --no-cache python3 make g++
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"]