f1162e6958
生产环境代码已打包到镜像中,无需挂载 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
57 lines
1.5 KiB
YAML
57 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: ../deploy/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=NsNBSQm4b7SzhR
|
||
|
||
# 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:
|
||
- ../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
|