Files
thebet365/docker-compose.prod.yml
Mars cb9a1e8708 feat: 短信调试日志、Tawk 客服、手机号校验放宽与 Docker 文档
API
- 短信发码/验码/创蓝全链路结构化日志(手机号脱敏)
- 新增 SMS_DEBUG_LOG_CODE,联调时可输出验证码与 sessionId(对应创蓝批次号)
- 注册成功、短信找回密码成功写入审计相关日志
- 放宽手机号归一化:移除区号白名单与 10~15 位长度限制

Player
- 公告走马灯滚动周期调整为 35 秒
- 在线客服接入 Tawk.to(tawk.html),登录用户透传昵称/头像/ID
- 三语补充 support.connecting 文案

部署与文档
- docker-compose 与 .env.docker.example 增加 SMS_DEBUG_LOG_CODE
- 新增 docs/短信调试与日志说明.md、docs/docker 镜像构建导出脚本与说明
- Docker 部署指南补充镜像构建文档链接
- .gitignore 忽略 thebet365-images.tar 与 docker-build.log

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 14:08:00 +08:00

109 lines
2.8 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.
# TheBet365 全栈生产部署
# 一键启动: docker compose -f docker-compose.prod.yml up -d --build
# 首次部署建议 SEED_DATABASE=true见 .env.docker
services:
postgres:
image: postgres:16-alpine
container_name: thebet365-postgres
environment:
POSTGRES_USER: thebet365
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-thebet365}
POSTGRES_DB: thebet365
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U thebet365']
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
networks:
- thebet365
redis:
image: redis:7-alpine
container_name: thebet365-redis
volumes:
- redis_data:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- thebet365
api:
build:
context: .
dockerfile: docker/api/Dockerfile
container_name: thebet365-api
environment:
DATABASE_URL: postgresql://thebet365:${POSTGRES_PASSWORD:-thebet365}@postgres:5432/thebet365
REDIS_URL: redis://redis:6379
JWT_SECRET: ${JWT_SECRET:-change-me-in-production-use-long-random-string}
JWT_PLAYER_EXPIRES: ${JWT_PLAYER_EXPIRES:-24h}
JWT_ADMIN_EXPIRES: ${JWT_ADMIN_EXPIRES:-2h}
JWT_AGENT_EXPIRES: ${JWT_AGENT_EXPIRES:-8h}
PORT: 3000
NODE_ENV: production
UPLOAD_DIR: /app/uploads
SEED_DATABASE: ${SEED_DATABASE:-false}
CHUANGLAN_ACCOUNT: ${CHUANGLAN_ACCOUNT}
CHUANGLAN_PASSWORD: ${CHUANGLAN_PASSWORD}
CHUANGLAN_ENDPOINT: ${CHUANGLAN_ENDPOINT:-https://sgap.253.com/send/sms}
CHUANGLAN_CONNECT_TIMEOUT_MS: ${CHUANGLAN_CONNECT_TIMEOUT_MS:-10000}
CHUANGLAN_READ_TIMEOUT_MS: ${CHUANGLAN_READ_TIMEOUT_MS:-10000}
SMS_CODE_TTL_SECONDS: ${SMS_CODE_TTL_SECONDS:-300}
SMS_RATE_LIMIT_SECONDS: ${SMS_RATE_LIMIT_SECONDS:-60}
SMS_DEBUG_LOG_CODE: ${SMS_DEBUG_LOG_CODE:-false}
volumes:
- uploads_data:/app/uploads
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ports:
- '${API_PORT:-3000}:3000'
restart: unless-stopped
networks:
- thebet365
player:
build:
context: .
dockerfile: docker/player/Dockerfile
container_name: thebet365-player
depends_on:
- api
ports:
- '${PLAYER_PORT:-8082}:80'
restart: unless-stopped
networks:
- thebet365
admin:
build:
context: .
dockerfile: docker/admin/Dockerfile
container_name: thebet365-admin
depends_on:
- api
ports:
- '${ADMIN_PORT:-8081}:80'
restart: unless-stopped
networks:
- thebet365
networks:
thebet365:
name: thebet365
volumes:
postgres_data:
redis_data:
uploads_data: