Files
xiaoxia-saas/infra/docker/web.Dockerfile
T
2026-06-20 14:08:27 +08:00

20 lines
564 B
Docker

# Build stage
FROM node:20 AS builder
WORKDIR /app
ARG VITE_API_URL=http://47.98.113.167:8000
ENV VITE_API_URL=$VITE_API_URL
COPY apps/web/package.json ./apps/web/package.json
COPY apps/web/ ./apps/web/
WORKDIR /app/apps/web
RUN npm config set registry https://registry.npmmirror.com \
&& npm install \
&& npm run build
# Production stage with nginx
FROM nginx:alpine AS runner
WORKDIR /usr/share/nginx/html
COPY --from=builder /app/apps/web/dist ./
COPY infra/docker/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]