chore: add sqszx202 deployment config
This commit is contained in:
31
deploy/docker/step1-integral-sqszx202/.env.example
Normal file
31
deploy/docker/step1-integral-sqszx202/.env.example
Normal file
@@ -0,0 +1,31 @@
|
||||
# =============================================================
|
||||
# 步骤一:寄卖商城环境变量 — 宿迁盛泽鑫商贸 sqszx202
|
||||
# cp .env.example .env 并填入真实密码
|
||||
# .env 不入库
|
||||
# =============================================================
|
||||
|
||||
TZ=Asia/Shanghai
|
||||
|
||||
# ---------- Redis(容器内) ----------
|
||||
REDIS_PASSWORD=change-me-redis
|
||||
|
||||
# ---------- H5 对外域名(浏览器可达) ----------
|
||||
INTEGRAL_TITLE=宿迁盛泽鑫商贸
|
||||
INTEGRAL_API_PUBLIC_URL=https://admin.j3s4s5.com
|
||||
INTEGRAL_IMG_PUBLIC_URL=https://admin.j3s4s5.com
|
||||
INTEGRAL_H5_PUBLIC_URL=https://j3s4s5.com/
|
||||
INTEGRAL_SN_ID=17533260260612
|
||||
INTEGRAL_APP_STR=ZFyTNQTWEkCBczKzyUDJWE9Ecx260612
|
||||
INTEGRAL_CONTRACT_PAGE=10012
|
||||
|
||||
# ---------- 宿主机暴露端口 ----------
|
||||
INTEGRAL_H5_PORT=18080
|
||||
# webman API 直连端口(宝塔 Nginx admin.j3s4s5.com → 此端口)
|
||||
RESELL_API_PORT=18085
|
||||
|
||||
# ---------- 宿主机目录映射(bind mount,与原部署路径一致)----------
|
||||
# 寄卖商城 H5 静态文件目录(手动改 JS/configs.js 直接生效,无需重建镜像)
|
||||
RESELL_H5_DIR=/www/wwwroot/j3s4s5.com
|
||||
# webman 后台完整应用目录(FTP 上传新 webman.bin/public/ 后 restart 容器即可更新)
|
||||
# 上传图片、public/upload 等均包含在此目录内,无需单独挂载
|
||||
RESELL_HOUTAI_DIR=/www/wwwroot/admin.j3s4s5.com
|
||||
2
deploy/docker/step1-integral-sqszx202/.gitignore
vendored
Normal file
2
deploy/docker/step1-integral-sqszx202/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.env
|
||||
houtai.env
|
||||
105
deploy/docker/step1-integral-sqszx202/README.md
Normal file
105
deploy/docker/step1-integral-sqszx202/README.md
Normal file
@@ -0,0 +1,105 @@
|
||||
# 步骤一:寄卖商城 Docker 部署(宿迁盛泽鑫商贸 sqszx202)
|
||||
|
||||
项目:`integral-resell`(寄卖商城)
|
||||
服务:`redis` · `integral-houtai`(Webman PHP 8.0)· `integral-h5`(Nginx 静态站)· `edge-nginx`(Docker HTTPS 入口)
|
||||
|
||||
步骤二(积分商城)与本步骤完全独立,可以单独部署、单独重启。
|
||||
|
||||
> 这套目录结构与 `deploy/docker/step1-integral` 保持一致,按 `czleilei240` 已验证方案复制而来。
|
||||
> 当前默认域名假设为:
|
||||
> - 寄卖商城 H5:`j3s4s5.com`
|
||||
> - 寄卖商城后台/API:`admin.j3s4s5.com`
|
||||
> - 积分商城 H5:`jf.j3s4s5.com`
|
||||
> - 积分商城管理后台:`jfadmin.j3s4s5.com`
|
||||
>
|
||||
> 以上四个域名统一使用 `deploy/docker/ssl-cert/j3s4s5.com_cert/nginx/` 下的泛域名证书。
|
||||
|
||||
---
|
||||
|
||||
## 快速部署
|
||||
|
||||
```bash
|
||||
cd deploy/docker/step1-integral-sqszx202
|
||||
|
||||
# 1. 准备环境变量
|
||||
cp .env.example .env
|
||||
cp houtai.env.example houtai.env
|
||||
vim .env
|
||||
vim houtai.env
|
||||
|
||||
# 2. 首次部署:在服务器上确保宿主机目录存在
|
||||
mkdir -p /www/wwwroot/j3s4s5.com
|
||||
mkdir -p /www/wwwroot/admin.j3s4s5.com/public/upload
|
||||
|
||||
# 3. 将 H5 静态文件同步到宿主机目录(首次 / 每次前端更新后)
|
||||
rsync -av h5/ /www/wwwroot/j3s4s5.com/
|
||||
chmod -R a+rX /www/wwwroot/j3s4s5.com
|
||||
|
||||
# 4. 构建并启动,edge-nginx 会在宿主机监听 80/443
|
||||
docker compose --env-file .env up -d --build
|
||||
|
||||
# 5. 查看状态
|
||||
docker compose --env-file .env ps
|
||||
docker compose --env-file .env logs -f integral-houtai
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 目录映射
|
||||
|
||||
| 宿主机路径 | 容器路径 | 用途 |
|
||||
|---|---|---|
|
||||
| `/www/wwwroot/j3s4s5.com` | `/usr/share/nginx/html` | H5 静态文件,手动改 JS 即时生效 |
|
||||
| `/www/wwwroot/admin.j3s4s5.com` | `/app` | webman 后台完整应用目录 |
|
||||
| `./houtai.env` | `/app/.env` | 运行时配置,只读挂入 |
|
||||
| `../ssl-cert/j3s4s5.com_cert/nginx` | `/etc/nginx/ssl/j3s4s5.com_cert` | `j3s4s5.com`、`admin.j3s4s5.com`、`jf.j3s4s5.com`、`jfadmin.j3s4s5.com` 共用 SSL 证书 |
|
||||
| `integral-runtime`(named vol)| `/app/runtime` | webman PID、session 等运行时数据 |
|
||||
|
||||
| 域名 | 用途 | Docker 容器端口 | 宿主机端口 | Docker 入口 |
|
||||
|---|---|---|---|---|
|
||||
| `j3s4s5.com` | 寄卖商城 H5 | integral-h5:80 | **80/443**,直连测试 **18080** | `edge-nginx` |
|
||||
| `admin.j3s4s5.com` | 寄卖商城 API / 后台 | integral-houtai:**8785** | **80/443**,直连测试 **18085** | `edge-nginx` |
|
||||
|
||||
---
|
||||
|
||||
## 验证
|
||||
|
||||
| 地址 | 预期 |
|
||||
|------|------|
|
||||
| `https://j3s4s5.com/` | 寄卖商城 H5 首页 |
|
||||
| `https://admin.j3s4s5.com/api/...` | 寄卖商城 API |
|
||||
| `http://59.110.91.202:18080/` | H5 直连测试 |
|
||||
| `ss -lntp \| grep -E ':(80\|443)'` | 看到 Docker Nginx 监听宿主机 80/443 |
|
||||
|
||||
---
|
||||
|
||||
## 常用命令
|
||||
|
||||
```bash
|
||||
docker compose --env-file .env restart integral-houtai
|
||||
docker compose --env-file .env restart edge-nginx
|
||||
docker compose --env-file .env logs -f integral-houtai
|
||||
docker compose --env-file .env logs -f edge-nginx
|
||||
docker compose --env-file .env exec integral-houtai bash
|
||||
docker compose --env-file .env down
|
||||
docker compose --env-file .env down -v
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 关键一致性检查
|
||||
|
||||
| 位置 | 值 |
|
||||
|---|---|
|
||||
| `.env` INTEGRAL_API_PUBLIC_URL | `https://admin.j3s4s5.com` |
|
||||
| `.env` INTEGRAL_H5_PUBLIC_URL | `https://j3s4s5.com/` |
|
||||
| `.env` INTEGRAL_APP_STR | `ZFyTNQTWEkCBczKzyUDJWE9Ecx260612` |
|
||||
| `houtai.env` APP_SECRET | 同上 |
|
||||
| `.env` INTEGRAL_SN_ID | `17533260260612` |
|
||||
|
||||
---
|
||||
|
||||
## 待确认项
|
||||
|
||||
- 短信当前使用阿里云签名 `宿迁盛泽鑫商贸`、模板 `SMS_335105539`,如更换短信账号需同步更新 `houtai.env`
|
||||
- 如果寄卖后台域名不是 `admin.j3s4s5.com`,请统一替换 `.env.example`、README 和入口 Nginx 配置
|
||||
102
deploy/docker/step1-integral-sqszx202/docker-compose.yml
Normal file
102
deploy/docker/step1-integral-sqszx202/docker-compose.yml
Normal file
@@ -0,0 +1,102 @@
|
||||
# =============================================================
|
||||
# 步骤一:寄卖商城(integral-resell)独立部署
|
||||
# 客户:宿迁盛泽鑫商贸 sqszx202
|
||||
# 包含服务:redis · integral-houtai(webman) · integral-h5(Nginx) · edge-nginx(HTTPS入口)
|
||||
# =============================================================
|
||||
|
||||
name: resell-sqszx202
|
||||
|
||||
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:
|
||||
<<: *common
|
||||
build:
|
||||
context: .
|
||||
dockerfile: redis.Dockerfile
|
||||
image: resell-sqszx202/redis:local
|
||||
container_name: integral-redis-sqszx202
|
||||
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
|
||||
|
||||
integral-houtai:
|
||||
<<: *common
|
||||
build:
|
||||
context: ../integral-resell
|
||||
dockerfile: houtai.Dockerfile
|
||||
image: resell-sqszx202/houtai:latest
|
||||
container_name: integral-houtai-sqszx202
|
||||
networks: [integral-net]
|
||||
ports:
|
||||
- "${RESELL_API_PORT:-18085}:8785"
|
||||
volumes:
|
||||
- ${RESELL_HOUTAI_DIR}:/app
|
||||
- ./houtai.env:/app/.env:ro
|
||||
- integral-runtime:/app/runtime
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
|
||||
integral-h5:
|
||||
<<: *common
|
||||
build:
|
||||
context: ../integral-resell
|
||||
dockerfile: h5.Dockerfile
|
||||
image: resell-sqszx202/h5:latest
|
||||
container_name: integral-h5-sqszx202
|
||||
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:
|
||||
- ${RESELL_H5_DIR}:/usr/share/nginx/html
|
||||
ports:
|
||||
- "${INTEGRAL_H5_PORT:-18080}:80"
|
||||
depends_on:
|
||||
- integral-houtai
|
||||
|
||||
edge-nginx:
|
||||
<<: *common
|
||||
image: nginx:1.25-alpine
|
||||
container_name: edge-nginx-sqszx202
|
||||
networks: [integral-net]
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./nginx-edge.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- ../ssl-cert/j3s4s5.com_cert/nginx:/etc/nginx/ssl/j3s4s5.com_cert:ro
|
||||
depends_on:
|
||||
- integral-h5
|
||||
- integral-houtai
|
||||
37
deploy/docker/step1-integral-sqszx202/houtai.env.example
Normal file
37
deploy/docker/step1-integral-sqszx202/houtai.env.example
Normal file
@@ -0,0 +1,37 @@
|
||||
# =============================================================
|
||||
# Webman 后端运行时配置 — 宿迁盛泽鑫商贸 sqszx202(寄卖商城)
|
||||
# cp houtai.env.example houtai.env 并填入真实密码
|
||||
# houtai.env 不入库,由 docker-compose volumes: 挂入 /app/.env
|
||||
# =============================================================
|
||||
|
||||
# MySQL(阿里云 RDS)
|
||||
DB_HOST = 'rm-bp1a178eq62lxba9xbo.mysql.rds.aliyuncs.com'
|
||||
DB_PORT = 3306
|
||||
DB_DATABASE = 'sqszx202'
|
||||
DB_USERNAME = 'yangtangyoupin'
|
||||
DB_PASSWORD = 'change-me'
|
||||
|
||||
# Redis(指向同 compose 内的 redis 容器)
|
||||
REDIS_HOST = 'redis'
|
||||
REDIS_PORT = 6379
|
||||
REDIS_PASSWORD = 'change-me-redis'
|
||||
|
||||
# 短信(需按该项目实际通道填写)
|
||||
SMS_CHANNEL = 'alibaba'
|
||||
SMS_SIGNNAME = '宿迁盛泽鑫商贸'
|
||||
SMS_TEMPLATE = 'SMS_335105539'
|
||||
SMS_KEYID = 'LTAI5t6PReihGTE4zGJk1Sxa'
|
||||
SMS_KEYSECRET = 'rzFeYQ21VOIwf0wAnxYcY10uPjoiJ4'
|
||||
SMS_SDKAPPID = ''
|
||||
|
||||
# OSS(不启用则走本地 public/upload)
|
||||
FILE_STORAGE = 'public'
|
||||
OSS_ACCESS_ID = ''
|
||||
OSS_ACCESS_SECRET = ''
|
||||
OSS_BUCKET = ''
|
||||
OSS_ENDPOINT = ''
|
||||
OSS_URL = ''
|
||||
|
||||
# 业务标识(须与 H5 configs.js 的 sn_id / appStr 以及积分商城 admin 后台一致)
|
||||
APP_SIGN = '1'
|
||||
APP_SECRET = 'ZFyTNQTWEkCBczKzyUDJWE9Ecx260612'
|
||||
102
deploy/docker/step1-integral-sqszx202/nginx-edge.conf
Normal file
102
deploy/docker/step1-integral-sqszx202/nginx-edge.conf
Normal file
@@ -0,0 +1,102 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name j3s4s5.com admin.j3s4s5.com jf.j3s4s5.com jfadmin.j3s4s5.com;
|
||||
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name jf.j3s4s5.com;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/j3s4s5.com_cert/j3s4s5.com.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/j3s4s5.com_cert/j3s4s5.com.key;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
|
||||
client_max_body_size 50m;
|
||||
|
||||
location / {
|
||||
proxy_pass http://host.docker.internal:18082;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name jfadmin.j3s4s5.com;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/j3s4s5.com_cert/j3s4s5.com.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/j3s4s5.com_cert/j3s4s5.com.key;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
|
||||
client_max_body_size 50m;
|
||||
|
||||
location / {
|
||||
proxy_pass http://host.docker.internal:18081;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name j3s4s5.com;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/j3s4s5.com_cert/j3s4s5.com.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/j3s4s5.com_cert/j3s4s5.com.key;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
|
||||
client_max_body_size 50m;
|
||||
|
||||
location / {
|
||||
proxy_pass http://integral-h5:80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name admin.j3s4s5.com;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/j3s4s5.com_cert/j3s4s5.com.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/j3s4s5.com_cert/j3s4s5.com.key;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
|
||||
client_max_body_size 50m;
|
||||
|
||||
location / {
|
||||
proxy_pass http://integral-houtai:8785;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
13
deploy/docker/step1-integral-sqszx202/redis.Dockerfile
Normal file
13
deploy/docker/step1-integral-sqszx202/redis.Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
# 使用 Alpine 通过 apk 安装 Redis,绕过镜像源问题
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache redis tzdata \
|
||||
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
VOLUME /data
|
||||
WORKDIR /data
|
||||
EXPOSE 6379
|
||||
|
||||
ENTRYPOINT ["redis-server"]
|
||||
Reference in New Issue
Block a user