This commit is contained in:
dongsk
2026-08-28 16:07:18 +08:00
parent d027eba044
commit cbb5cfd167
2 changed files with 58 additions and 4 deletions
+6 -3
View File
@@ -21,9 +21,12 @@ FROM nginx:alpine
# 将构建产物复制到 Nginx 默认静态目录
COPY --from=builder /app/dist /usr/share/nginx/html
# 自定义 Nginx 配置:支持 SPA 路由 fallback + gzip
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Nginx 配置模板(支持 envsubst 环境变量替换)
COPY nginx.conf /etc/nginx/templates/default.conf.template
EXPOSE 80
# 默认后端 API 地址(运行时可通过 -e BACKEND_URL=... 覆盖)
ENV BACKEND_URL=http://host.docker.internal:8000
EXPOSE 8901
CMD ["nginx", "-g", "daemon off;"]