17 lines
494 B
Docker
17 lines
494 B
Docker
# ---------- Build stage ----------
|
|
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json* pnpm-lock.yaml* ./
|
|
RUN npm ci --ignore-scripts --prefer-offline
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# ---------- Production stage ----------
|
|
FROM nginx:1.25-alpine AS prod
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
# Remove default config and add minimal one
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
|
COPY nginx.conf /etc/nginx/conf.d
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|