activity-simulation / Dockerfile
Augusto Diaz
Dockerfile: build production and serve static with serve@14
cf703eb
Raw
History Blame Contribute Delete
433 Bytes
FROM node:18-alpine as builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --legacy-peer-deps
# Copy source code
COPY . .
# Build production assets
RUN npm run build
FROM node:18-alpine as runner
WORKDIR /app
# Install a tiny static server
RUN npm i -g serve@14
# Copy built assets
COPY --from=builder /app/dist /app/dist
EXPOSE 3000
CMD ["serve", "-s", "dist", "-l", "3000"]