合并应用宝 Worker 容器
This commit is contained in:
+4
-26
@@ -37,8 +37,8 @@ services:
|
||||
- COOKIE_SECURE=${COOKIE_SECURE:-false}
|
||||
# CORS 允许的源(逗号分隔)
|
||||
- CORS_ORIGINS=${CORS_ORIGINS:-}
|
||||
# 独立 yyb-worker 容器,只通过 Compose 默认内网访问。
|
||||
- YYB_WORKER_URL=${YYB_WORKER_URL:-http://yyb-worker:8810}
|
||||
# Worker 已合并到本容器,仅通过回环地址访问。
|
||||
- YYB_WORKER_URL=http://127.0.0.1:8810
|
||||
- YYB_WORKER_KEY=${YYB_WORKER_KEY:-}
|
||||
# Roundcube 邮件验证码读取服务地址(不填则使用代码默认值)
|
||||
- MAIL_ROUNDCUBE_URL=${MAIL_ROUNDCUBE_URL:-}
|
||||
@@ -50,21 +50,19 @@ services:
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
yyb-worker:
|
||||
condition: service_healthy
|
||||
# 增加文件描述符限制,避免 "Too many open files" 错误
|
||||
ulimits:
|
||||
nofile:
|
||||
soft: 65536
|
||||
hard: 65536
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8800/api/health')"]
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8800/api/health'); urllib.request.urlopen('http://127.0.0.1:8810/health')"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
mysql:
|
||||
image: ${MYSQL_IMAGE:-docker.m.daocloud.io/library/mysql:8.4}
|
||||
image: ${MYSQL_IMAGE:-mysql:8.4}
|
||||
container_name: douyu-login-db
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
@@ -88,28 +86,8 @@ services:
|
||||
retries: 12
|
||||
start_period: 20s
|
||||
|
||||
yyb-worker:
|
||||
build:
|
||||
context: ./services/yyb-worker
|
||||
image: ${YYB_WORKER_IMAGE:-douyu-yyb-worker:local}
|
||||
container_name: douyu-yyb-worker
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- YYB_WORKER_KEY=${YYB_WORKER_KEY:?请在 .env 中设置 YYB_WORKER_KEY}
|
||||
volumes:
|
||||
- yyb-worker-data:/app/config/worker-jobs
|
||||
networks:
|
||||
- default
|
||||
healthcheck:
|
||||
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8810/health')"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
mysql-data:
|
||||
yyb-worker-data:
|
||||
|
||||
networks:
|
||||
order-site-net:
|
||||
|
||||
Reference in New Issue
Block a user