Files
skript-be/Dockerfile
Fahri Can Seçer bbec8f09bb
Some checks failed
Build and Deploy Backend / build-and-push (push) Failing after 3m5s
Build and Deploy Backend / deploy (push) Has been skipped
main
2026-01-28 02:31:36 +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"]