15 lines
351 B
Docker
15 lines
351 B
Docker
|
|
# frontend/Dockerfile
|
||
|
|
FROM node:20-alpine AS builder
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
COPY package*.json ./
|
||
|
|
RUN npm ci # clean install, respects lockfile
|
||
|
|
|
||
|
|
COPY . .
|
||
|
|
RUN npm run build # produces ./dist
|
||
|
|
|
||
|
|
# ---- Runtime image (optional) ----
|
||
|
|
FROM nginx:stable-alpine
|
||
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
||
|
|
EXPOSE 80
|
||
|
|
CMD ["nginx", "-g", "daemon off;"]
|