26 lines
505 B
Docker
26 lines
505 B
Docker
# Frontend — multi-stage build (Vite + Nginx)
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
|
|
ENV VITE_API_BASE=/api/v1
|
|
|
|
RUN npm run build
|
|
|
|
FROM nginx:alpine
|
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
|
CMD wget --quiet --tries=1 --spider http://localhost:80/health || exit 1
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|