fix(docker): surface backend crash logs in docker logs and print DB target
Build and Deploy / build-and-push (push) Successful in 52s

This commit is contained in:
2026-07-26 15:20:56 +08:00
parent afe7833539
commit 472b956203
4 changed files with 51 additions and 15 deletions
+15 -13
View File
@@ -1,27 +1,29 @@
[supervisord]
nodaemon=true
logfile=/app/logs/supervisord.log
logfile=/dev/null
pidfile=/var/run/supervisord.pid
user=root
loglevel=info
[program:backend]
command=/app/taskpool server
command=/bin/sh /app/start-backend.sh
directory=/app
autostart=true
autorestart=true
startsecs=3
startretries=10
stderr_logfile=/app/logs/backend.err.log
stdout_logfile=/app/logs/backend.out.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
# 不写死 BH_DB_*,避免覆盖 compose 注入的 MySQL/Postgres。
# 仅在 compose 未设置时提供默认监听参数。
environment=BH_SERVER_PORT="8052",BH_SERVER_HOST="0.0.0.0"
startsecs=2
startretries=20
# 关键:把 backend 日志打到 docker logs,而不是只写文件
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
# 不在此写 environment=,完整继承 compose/container 环境变量
[program:nginx]
command=nginx -g "daemon off;"
autostart=true
autorestart=true
stderr_logfile=/app/logs/nginx.err.log
stdout_logfile=/app/logs/nginx.out.log
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0