Files
integral-shop/deploy/docker/step2-single-shop/docker-compose.yml
danaisuiyuan fb76270882 feat(deploy): 完整 Docker 部署方案 — 寄卖商城 + 积分商城
新增两步独立 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>
2026-05-17 17:24:08 +08:00

164 lines
5.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# =============================================================
# 步骤二积分商城single-shop-22独立部署
# 客户:池州雷蕾商贸 czleilei240
# 包含服务redis · single-admin-api · single-front-api
# single-admin-web(Vue) · single-h5(uni-app)
# =============================================================
name: jifenmall-czleilei240
x-common: &common
restart: unless-stopped
environment:
TZ: ${TZ:-Asia/Shanghai}
logging:
driver: json-file
options:
max-size: "20m"
max-file: "5"
x-spring-common: &spring-common
<<: *common
environment:
TZ: ${TZ:-Asia/Shanghai}
MYSQL_HOST: ${RDS_HOST}
MYSQL_DATABASE: ${RDS_DB}
MYSQL_USERNAME: ${RDS_USER}
MYSQL_PASSWORD: ${RDS_PASSWORD}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
SYNC_SOURCE_ID: ${SYNC_SOURCE_ID:-shop_15}
SYNC_TARGET_MER_ID: ${SYNC_TARGET_MER_ID:-15}
networks:
single-net:
driver: bridge
volumes:
single-redis-data:
single-front-logs:
single-admin-logs:
services:
# ---------- Redis ----------
redis:
<<: *common
image: redis:6.2-alpine
container_name: single-redis
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}", "--appendonly", "yes"]
volumes:
- single-redis-data:/data
networks: [single-net]
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 10s
timeout: 3s
retries: 5
# ---------- Front API用户端 Spring Boot ----------
single-front-api:
<<: *spring-common
build:
context: ../../../single-shop-22/backend
dockerfile: ../../deploy/docker/single-shop/front-api.Dockerfile
image: jifenmall-czleilei240/front-api:latest
container_name: single-front-api
networks: [single-net]
volumes:
# 图片/PDF 目录 bind mount 到宿主机,与步骤一 H5 Nginx 共享同一路径
# /www/wwwroot/leilei.czchunfang.com/crmebimage/ → 通过 leilei.czchunfang.com 对外访问
- ${CRMEB_IMAGE_DIR}:/usr/local/crmeb/crmebimage
- single-front-logs:/app/log
- ../single-shop/application-docker.yml:/config/application-docker.yml:ro
environment:
TZ: ${TZ:-Asia/Shanghai}
MYSQL_HOST: ${RDS_HOST}
MYSQL_DATABASE: ${RDS_DB}
MYSQL_USERNAME: ${RDS_USER}
MYSQL_PASSWORD: ${RDS_PASSWORD}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
SYNC_SOURCE_ID: ${SYNC_SOURCE_ID:-shop_15}
SYNC_TARGET_MER_ID: ${SYNC_TARGET_MER_ID:-15}
SERVER_PORT: 30033
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:30033/actuator/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 90s
# ---------- Admin API管理端 Spring Boot ----------
single-admin-api:
<<: *spring-common
build:
context: ../../../single-shop-22/backend
dockerfile: ../../deploy/docker/single-shop/admin-api.Dockerfile
image: jifenmall-czleilei240/admin-api:latest
container_name: single-admin-api
networks: [single-net]
volumes:
# 图片/PDF 目录 bind mount 到宿主机,与步骤一 H5 Nginx 共享同一路径
# /www/wwwroot/leilei.czchunfang.com/crmebimage/ → 通过 leilei.czchunfang.com 对外访问
- ${CRMEB_IMAGE_DIR}:/usr/local/crmeb/crmebimage
- single-admin-logs:/app/log
- ../single-shop/application-docker.yml:/config/application-docker.yml:ro
environment:
TZ: ${TZ:-Asia/Shanghai}
MYSQL_HOST: ${RDS_HOST}
MYSQL_DATABASE: ${RDS_DB}
MYSQL_USERNAME: ${RDS_USER}
MYSQL_PASSWORD: ${RDS_PASSWORD}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
SYNC_SOURCE_ID: ${SYNC_SOURCE_ID:-shop_15}
SYNC_TARGET_MER_ID: ${SYNC_TARGET_MER_ID:-15}
SERVER_PORT: 30032
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:30032/actuator/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 90s
# ---------- Admin WebVue 管理后台) ----------
single-admin-web:
<<: *common
build:
context: ../../../single-shop-22/backend-adminend
dockerfile: ../../deploy/docker/single-shop/admin-web.Dockerfile
args:
VUE_APP_BASE_API: ${SINGLE_ADMIN_API_PUBLIC_URL}
image: jifenmall-czleilei240/admin-web:latest
container_name: single-admin-web
networks: [single-net]
ports:
- "${SINGLE_ADMIN_PORT:-18081}:80"
depends_on:
- single-admin-api
# ---------- H5 前端uni-app ----------
single-h5:
<<: *common
build:
context: ../../../single-shop-22/single_uniapp22miao
dockerfile: ../../deploy/docker/single-shop/h5.Dockerfile
args:
H5_API_DOMAIN: ${SINGLE_FRONT_API_PUBLIC_URL}
image: jifenmall-czleilei240/h5:latest
container_name: single-h5
networks: [single-net]
ports:
- "${SINGLE_H5_PORT:-18082}:80"
depends_on:
- single-front-api