17 lines
324 B
Docker
17 lines
324 B
Docker
# Build stage
|
|
FROM node:18-slim AS builder
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
COPY . .
|
|
|
|
# Production stage
|
|
FROM node:18-slim
|
|
WORKDIR /app
|
|
COPY --from=builder /app/package*.json ./
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/index.js ./
|
|
|
|
EXPOSE 3000
|
|
CMD ["node", "index.js"]
|