Files
x-server-mobile/deploy/docker-compose.prod.yml
T

59 lines
1.6 KiB
YAML
Raw Normal View History

# X-Server Mobile 生产环境 Docker Compose
# 使用方法: docker-compose -f 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-409s
- DB_PORT=3306
- DB_DATABASE=xserver
- DB_USERNAME=xserver
- DB_PASSWORD=${DB_PASSWORD:-change_me_in_production}
# Redis 配置(使用 1Panel 的 Redis)
# 注意:请替换为实际的容器名和密码
- REDIS_HOST=1Panel-redis-xxxx
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD:-change_me_in_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