Files
xiaoxia-saas/infra/docker/web.Dockerfile
T
xiaoxia 0fb4d95bd0 fix: Web Dockerfile API URL 改为通用默认值
- 将硬编码的 VITE_API_URL=http://47.98.113.167:8000 改为 https://saas-api.xiaoxiajianji.com
- 支持通过 --build-arg VITE_API_URL=xxx 在构建时覆盖默认值
2026-06-27 00:02:34 +08:00

20 lines
627 B
Docker

# Build stage
FROM docker.m.daocloud.io/library/node:20 AS builder
WORKDIR /app
ARG VITE_API_URL=https://saas-api.xiaoxiajianji.com
ENV VITE_API_URL=$VITE_API_URL
COPY apps/web/package.json apps/web/package-lock.json ./apps/web/
WORKDIR /app/apps/web
RUN npm config set registry https://registry.npmmirror.com \
&& npm ci
COPY apps/web/ ./
RUN npm run build
# Production stage with nginx
FROM docker.m.daocloud.io/library/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;"]