ebac0c8452
- 后端代码在 server/ 目录(Git 仓库)
- docker-compose 在 deploy/ 目录
- 部署脚本路径更新
- 部署文档更新
目录结构:
/opt/1panel/www/sites/uniservice-mobile.hnxinyouhe.com/index/
├── index.html # 前端入口
├── assets/ # 前端静态资源
└── server/ # 整个项目(Git)
├── backend/
├── deploy/
└── logs/
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
# X-Server Mobile 生产环境 Docker Compose
|
||
# 位置: server/deploy/docker-compose.prod.yml
|
||
# 项目根目录执行: docker-compose -f deploy/docker-compose.prod.yml up -d
|
||
|
||
services:
|
||
# PHP 后端服务
|
||
backend:
|
||
build:
|
||
context: ../backend
|
||
dockerfile: Dockerfile.prod
|
||
container_name: x-server-backend-prod
|
||
restart: unless-stopped
|
||
ports:
|
||
- "8787:8787"
|
||
environment:
|
||
# 应用环境
|
||
- APP_ENV=production
|
||
- APP_DEBUG=false
|
||
|
||
# 数据库配置(1Panel MySQL)
|
||
- DB_HOST=1Panel-mysql-XyxS
|
||
- DB_PORT=3306
|
||
- DB_DATABASE=xserver
|
||
- DB_USERNAME=xserver
|
||
- DB_PASSWORD=NsNBSQm4b2b7SzhR
|
||
|
||
# Redis 配置(1Panel Redis)
|
||
- REDIS_HOST=1Panel-redis-pxdb
|
||
- REDIS_PORT=6379
|
||
- REDIS_PASSWORD=redis_FTzdM6
|
||
|
||
# 飞书配置(从 .env.production 读取)
|
||
- FEISHU_APP_ID=${FEISHU_APP_ID}
|
||
- FEISHU_APP_SECRET=${FEISHU_APP_SECRET}
|
||
- FEISHU_ENCRYPT_KEY=${FEISHU_ENCRYPT_KEY}
|
||
- FEISHU_VERIFICATION_TOKEN=${FEISHU_VERIFICATION_TOKEN}
|
||
- FEISHU_TENANT_KEY=${FEISHU_TENANT_KEY:-14e7bc0fe5985740}
|
||
volumes:
|
||
- ../backend:/app
|
||
- ../logs/backend:/app/runtime/logs
|
||
networks:
|
||
- 1panel-network
|
||
healthcheck:
|
||
test: ["CMD", "php", "-r", "exit(0);"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
start_period: 40s
|
||
logging:
|
||
driver: "json-file"
|
||
options:
|
||
max-size: "10m"
|
||
max-file: "3"
|
||
|
||
networks:
|
||
1panel-network:
|
||
external: true
|