Docker-ImageManagementOptim.../multistage/Dockerfile

18 lines
262 B
Docker

# Dockerfile.multistage
FROM node:18 AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# Stage final, hanya copy file hasil dari builder
FROM node:18-slim
WORKDIR /app
COPY --from=builder /app .
EXPOSE 3000
CMD ["node", "app/index.js"]