Add log mount to docker compose (#1063)

* Expose container logs via Docker Compose

* Simplify Docker logs mount

* Update comments
This commit is contained in:
yzbf
2026-02-06 14:02:40 +08:00
committed by GitHub
parent 4d457b2215
commit c521d2ef36
5 changed files with 12 additions and 2 deletions

View File

@@ -10,3 +10,4 @@ venv/
.pytest_cache/
.claude/
.serena/
.logs/

1
.gitignore vendored
View File

@@ -10,3 +10,4 @@ venv/
.claude/
.serena/
.agents/
.logs/

View File

@@ -1,4 +1,4 @@
# Docker Mapping
# Docker Port Mapping
DOCKER_MAP_SERVER_PORT=8001
DOCKER_MAP_POSTGRES_PORT=15432
DOCKER_MAP_MYSQL_PORT=13306
@@ -15,3 +15,7 @@ DOCKER_MAP_ALLOY_HTTP_PORT=4318
DOCKER_MAP_ALLOY_UI_PORT=12345
DOCKER_MAP_TEMPO_PORT=3200
DOCKER_MAP_GRAFANA_PORT=3000
# Docker Log Mapping
# Production environment recommendation: /var/log/fba
DOCKER_FBA_SERVER_LOG=./logs/fba

View File

@@ -42,7 +42,7 @@ file=/tmp/supervisor.sock ; the path to the socket file
;password=123 ; default is no password (open server)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; main log file; default $CWD/supervisord.log
logfile=/var/log/fba/supervisord.log ; main log file; default $CWD/supervisord.log
logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB
logfile_backups=10 ; # of main logfile backups; 0 means none, default 10
loglevel=info ; log level; default info; others: debug,warn,trace

View File

@@ -42,6 +42,7 @@ services:
- ./deploy/backend/docker-compose/.env.server:/fba/backend/.env
- fba_static:/fba/backend/app/static
- fba_static_upload:/fba/backend/static/upload
- ${DOCKER_FBA_SERVER_LOG:-./logs/fba}:/var/log/fba
networks:
- fba_network
# 如果你是 mysql 用户,应将 fba_postgres:5432 修改为 fba_mysql:3306
@@ -186,6 +187,7 @@ services:
- fba_rabbitmq
volumes:
- ./deploy/backend/docker-compose/.env.server:/fba/backend/.env
- ${DOCKER_FBA_SERVER_LOG:-./logs/fba}:/var/log/fba
networks:
- fba_network
command:
@@ -212,6 +214,7 @@ services:
- fba_celery_worker
volumes:
- ./deploy/backend/docker-compose/.env.server:/fba/backend/.env
- ${DOCKER_FBA_SERVER_LOG:-./logs/fba}:/var/log/fba
networks:
- fba_network
command:
@@ -240,6 +243,7 @@ services:
- fba_celery_worker
volumes:
- ./deploy/backend/docker-compose/.env.server:/fba/backend/.env
- ${DOCKER_FBA_SERVER_LOG:-./logs/fba}:/var/log/fba
networks:
- fba_network
command: