portfolio/dockerfile
2025-05-01 23:58:23 +01:00

17 lines
314 B
Plaintext

# Stage 1: Build the application
FROM node:20.19-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Serve the application
FROM node:20.19-alpine
WORKDIR /app
COPY --from=builder /app ./
ENV NODE_ENV=production
ENV PORT=8080
EXPOSE 8080
CMD ["npm", "start"]