增加腾讯云生产 Docker 部署编排与一键脚本
- 提供 API/Web 多阶段镜像、Nginx 反代与 WS/文件路径 - docker-compose.prod 含 Postgres、MinIO、API、前端 - deploy.sh 生成密钥、构建启动、可选种子与备份脚本
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# 客服云前端 — Nginx 托管静态资源并反代 API / 文件
|
||||
# build context: 仓库根目录
|
||||
|
||||
FROM node:22-alpine AS builder
|
||||
|
||||
WORKDIR /web
|
||||
COPY web/package.json web/package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY web/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
RUN apk add --no-cache tzdata \
|
||||
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& echo Asia/Shanghai > /etc/timezone
|
||||
|
||||
COPY deploy/docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=builder /web/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=5 \
|
||||
CMD wget -qO- http://127.0.0.1/healthz || exit 1
|
||||
Reference in New Issue
Block a user