新增两步独立 Docker 部署方案(czleilei240 环境): 步骤一 寄卖商城(integral-resell) - step1-integral/docker-compose.yml:redis(Alpine自建) + houtai(webman PHP8) + h5(Nginx) - houtai.Dockerfile:PHP 8.0 + 阿里云镜像源 + webman.bin entrypoint - h5.Dockerfile:Nginx + configs.js 环境变量动态重写 - redis.Dockerfile:Alpine + apk 构建,绕过 DockerHub 镜像源问题 - 宿主机 bind-mount:/www/wwwroot/leileiadmin.czchunfang.com(FTP可直接更新程序) 步骤二 积分商城(single-shop-22) - step2-single-shop/docker-compose.yml:redis + admin-api + front-api + admin-web + h5 - Java Dockerfiles:OpenJDK 17 + --add-opens Spring Boot 2.2.6 兼容 公共配置 - nginx/:四个域名宝塔 Nginx 反代配置(HTTP→HTTPS 301、SSL 终止) - scripts/:sync-to-server.sh / deploy-step1.sh / remote-up.sh - DOCKER_DEPLOY.md:完整部署文档 Co-authored-by: Cursor <cursoragent@cursor.com>
96 lines
3.1 KiB
YAML
96 lines
3.1 KiB
YAML
# =============================================================
|
||
# 步骤一:寄卖商城(integral-resell)独立部署
|
||
# 客户:池州雷蕾商贸 czleilei240
|
||
# 包含服务:redis · integral-houtai(webman) · integral-h5(Nginx)
|
||
# =============================================================
|
||
|
||
name: resell-czleilei240
|
||
|
||
x-common: &common
|
||
restart: unless-stopped
|
||
environment:
|
||
TZ: ${TZ:-Asia/Shanghai}
|
||
logging:
|
||
driver: json-file
|
||
options:
|
||
max-size: "20m"
|
||
max-file: "5"
|
||
|
||
networks:
|
||
integral-net:
|
||
driver: bridge
|
||
|
||
volumes:
|
||
integral-redis-data:
|
||
integral-runtime:
|
||
|
||
services:
|
||
# ---------- Redis ----------
|
||
redis:
|
||
<<: *common
|
||
build:
|
||
context: .
|
||
dockerfile: redis.Dockerfile
|
||
image: resell-czleilei240/redis:local
|
||
container_name: integral-redis
|
||
command: ["--requirepass", "${REDIS_PASSWORD}", "--appendonly", "yes"]
|
||
volumes:
|
||
- integral-redis-data:/data
|
||
networks: [integral-net]
|
||
healthcheck:
|
||
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
|
||
interval: 10s
|
||
timeout: 3s
|
||
retries: 5
|
||
|
||
# ---------- Webman 后端 ----------
|
||
integral-houtai:
|
||
<<: *common
|
||
build:
|
||
context: ../../../integral-resell/houtai
|
||
dockerfile: ../../deploy/docker/integral-resell/houtai.Dockerfile
|
||
image: resell-czleilei240/houtai:latest
|
||
container_name: integral-houtai
|
||
networks: [integral-net]
|
||
ports:
|
||
# 宝塔 Nginx 直连 webman API(webman.bin 写死监听 8785)
|
||
- "${RESELL_API_PORT:-18085}:8785"
|
||
volumes:
|
||
# 整个应用目录挂到宿主机 /www/wwwroot/leileiadmin.czchunfang.com/
|
||
# FTP 上传新 webman.bin / public/ 后 docker compose restart integral-houtai 即可生效
|
||
- ${RESELL_HOUTAI_DIR}:/app
|
||
# .env 单独挂入(覆盖宿主机目录里的 .env),避免明文密码出现在 wwwroot
|
||
- ./houtai.env:/app/.env:ro
|
||
# runtime 使用命名卷(日志/session/pid 不受 FTP 覆盖影响)
|
||
- integral-runtime:/app/runtime
|
||
depends_on:
|
||
redis:
|
||
condition: service_healthy
|
||
|
||
# ---------- H5 静态站 ----------
|
||
integral-h5:
|
||
<<: *common
|
||
build:
|
||
context: ../../../integral-resell/h5
|
||
dockerfile: ../../deploy/docker/integral-resell/h5.Dockerfile
|
||
image: resell-czleilei240/h5:latest
|
||
container_name: integral-h5
|
||
networks: [integral-net]
|
||
environment:
|
||
TZ: ${TZ:-Asia/Shanghai}
|
||
INTEGRAL_TITLE: ${INTEGRAL_TITLE}
|
||
INTEGRAL_API_PUBLIC_URL: ${INTEGRAL_API_PUBLIC_URL}
|
||
INTEGRAL_IMG_PUBLIC_URL: ${INTEGRAL_IMG_PUBLIC_URL}
|
||
INTEGRAL_H5_PUBLIC_URL: ${INTEGRAL_H5_PUBLIC_URL}
|
||
INTEGRAL_SN_ID: ${INTEGRAL_SN_ID}
|
||
INTEGRAL_APP_STR: ${INTEGRAL_APP_STR}
|
||
INTEGRAL_CONTRACT_PAGE: ${INTEGRAL_CONTRACT_PAGE}
|
||
volumes:
|
||
# H5 静态文件目录挂到宿主机,手动更新 JS/configs.js 直接生效,无需重建镜像
|
||
# 子目录 crmebimage/ 同时由步骤二 Java 后端写入(PDF/图片),Nginx 直接对外提供访问
|
||
- ${RESELL_H5_DIR}:/usr/share/nginx/html
|
||
ports:
|
||
- "${INTEGRAL_H5_PORT:-18080}:80"
|
||
depends_on:
|
||
- integral-houtai
|