Files
x-server-mobile/deploy/docker-compose.prod.yml
T
root 7bdd0850f5 feat: 添加 1Panel 静态站点部署配置和线上部署指南
新增文件:
- deploy/docker-compose.prod.yml - 配置线上数据库和 Redis 连接
- deploy/nginx-1panel.conf - 1Panel Nginx 完整配置参考
- deploy/deploy-1panel.sh - 适配 1Panel 的自动部署脚本
- deploy/.env.production - 线上环境变量模板
- docs/DEPLOY_ONLINE_GUIDE.md - 详细部署说明文档

线上环境信息:
- 域名: uniservice-mobile.hnxinyouhe.com
- MySQL: 1Panel-mysql-XyxS
- Redis: 1Panel-redis-pxdb
- Docker 网络: 1panel-network

特性:
- 前后端分离部署
- 前端静态文件由 1Panel Nginx 直接托管
- 后端运行在 Docker 容器中
- 1Panel 面板管理 Nginx 配置和 SSL 证书

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:21:22 +08:00

57 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# X-Server Mobile 生产环境 Docker Compose
# 使用方法: 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
# 飞书配置(请替换为实际值)
- 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