Files
xiaoxia-saas/infra/docker/web.Dockerfile
T
xiaoxia 22c1085c4b
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
Tests / lint (pull_request) Failing after 143h18m2s
Tests / test (pull_request) Failing after 143h18m2s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 143h18m31s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 143h18m37s
Deploy / Deploy Staging (push) Failing after 143h19m29s
CI/CD Pipeline / Frontend Lint (push) Failing after 143h19m55s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 143h20m2s
fix: 永久修复 nginx proxy_pass 配置
- staging nginx.conf: 使用静态 proxy_pass 替代变量型(避免 URI 丢失)
- staging 指向容器名 xiaoxia-api-staging(避免 DNS 别名冲突)
- 添加 proxy_read_timeout/proxy_send_timeout 300s(与 production 对齐)
- web.Dockerfile: 支持 ARG NGINX_CONF 参数化(与 web-artifact.Dockerfile 一致)
- production nginx-production.conf 已确认无需修改
2026-07-03 13:34:12 +08:00

21 lines
656 B
Docker
Executable File

# 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
ARG NGINX_CONF=infra/docker/nginx.conf
WORKDIR /usr/share/nginx/html
COPY --from=builder /app/apps/web/dist ./
COPY ${NGINX_CONF} /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]