- docker-compose.prod.yml:修正 volumes 缩进(YAML 之前无法解析), 补齐 epay-ui.css/epay-ui.js/head.php/test.php 挂载(容器创建早于挂载配置,从未生效) - 重建 php 容器后 entrypoint 从 staging 同步补丁,后台全屏布局/侧栏/测试支付页恢复正常 - README:补充'重启变回原样'的机制说明与维护规范
110 lines
3.7 KiB
YAML
110 lines
3.7 KiB
YAML
services:
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: epay-nginx
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${NGINX_PORT:-80}:80"
|
|
volumes:
|
|
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- app_data:/var/www/html:ro
|
|
depends_on:
|
|
php:
|
|
condition: service_started
|
|
networks:
|
|
- epay-network
|
|
|
|
php:
|
|
image: ghcr.io/aliveranme/epay:latest
|
|
container_name: epay-php
|
|
restart: unless-stopped
|
|
environment:
|
|
TZ: Asia/Shanghai
|
|
DB_HOST: ${DB_HOST:-mysql}
|
|
DB_PORT: ${DB_PORT:-3306}
|
|
DB_USER: ${DB_USER:-epay}
|
|
DB_PASSWORD: ${DB_PASSWORD}
|
|
DB_NAME: ${DB_NAME:-epay}
|
|
DB_PREFIX: ${DB_PREFIX:-pay}
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
|
|
SITE_URL: ${SITE_URL:-http://localhost}
|
|
# 部署自定义配置(可选):API 接口是否校验 timestamp,1=开启(默认),0=关闭(兼容不传 timestamp 的老平台)
|
|
API_TIMESTAMP_CHECK: ${API_TIMESTAMP_CHECK:-}
|
|
volumes:
|
|
- app_data:/var/www/html
|
|
- ./plugins:/var/www/html/plugins
|
|
- uploads:/var/www/html/assets/uploads
|
|
- sessions:/var/lib/php/sessions
|
|
# 补丁:is_public_url 白名单(容器重启/升级后由 entrypoint 从 staging 自动同步)
|
|
- ./patches/functions.php:/var/www/html-staging/includes/functions.php:ro
|
|
# 补丁:后台布局覆盖 CSS(全屏自适应/侧栏加宽/导航两列)
|
|
- ./patches/epay-ui.css:/var/www/html-staging/assets/dist/epay-ui.css:ro
|
|
# 补丁:侧栏当前菜单自动滚动脚本
|
|
- ./patches/epay-ui.js:/var/www/html-staging/assets/dist/epay-ui.js:ro
|
|
# 补丁:后台入口资源版本号(?v= 强制回源)
|
|
- ./patches/head.php:/var/www/html-staging/admin/head.php:ro
|
|
# 补丁:测试支付页 paytype JSON 数组修复
|
|
- ./patches/test.php:/var/www/html-staging/user/test.php:ro
|
|
# 补丁:后台改密码存明文(与登录逻辑一致)+ 登录兼容历史 md5 存储
|
|
- ./patches/admin/set.php:/var/www/html-staging/admin/set.php:ro
|
|
- ./patches/admin/login.php:/var/www/html-staging/admin/login.php:ro
|
|
# 补丁:支付页轮询时主动向微信查单(异步回调延迟兜底),重启后由 staging 同步
|
|
- ./patches/getshop.php:/var/www/html-staging/getshop.php:ro
|
|
extra_hosts:
|
|
- "newapi.88531.cn:host-gateway"
|
|
- "ai.88531.cn:host-gateway"
|
|
- "pay.88531.cn:host-gateway"
|
|
networks:
|
|
- epay-network
|
|
|
|
mysql:
|
|
image: mysql:8.0
|
|
container_name: epay-mysql
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
MYSQL_DATABASE: ${DB_NAME:-epay}
|
|
MYSQL_USER: ${DB_USER:-epay}
|
|
MYSQL_PASSWORD: ${DB_PASSWORD}
|
|
TZ: Asia/Shanghai
|
|
command:
|
|
- --character-set-server=utf8mb4
|
|
- --collation-server=utf8mb4_unicode_ci
|
|
- --sql-mode=
|
|
- --default-time-zone=+08:00
|
|
- --default-authentication-plugin=mysql_native_password
|
|
volumes:
|
|
- mysql_data:/var/lib/mysql
|
|
networks:
|
|
- epay-network
|
|
|
|
cron:
|
|
image: alpine:latest
|
|
container_name: epay-cron
|
|
restart: unless-stopped
|
|
depends_on:
|
|
nginx:
|
|
condition: service_started
|
|
environment:
|
|
CRON_KEY: ${CRON_KEY}
|
|
SITE_URL: ${SITE_URL:-http://nginx}
|
|
entrypoint: |
|
|
/bin/sh -c '
|
|
apk add --no-cache curl tzdata;
|
|
ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime;
|
|
echo "*/5 * * * * curl -s -o /dev/null -w \"%{http_code}\" $${SITE_URL}/cron.php?key=$${CRON_KEY}" > /etc/crontabs/root;
|
|
crond -f -l 2
|
|
'
|
|
networks:
|
|
- epay-network
|
|
|
|
volumes:
|
|
app_data:
|
|
uploads:
|
|
sessions:
|
|
mysql_data:
|
|
|
|
networks:
|
|
epay-network:
|
|
driver: bridge
|