@@ -252,8 +252,10 @@ api only:
252252# # Step 4 — Compose override, build, and run
253253
254254The base `docker-compose.yml` mounts `./config` into each container read-only
255- (`/app/config`) and defaults `APP_CONFIG` to the `*.local.yaml` files. Add an
256- override that points `APP_CONFIG` at your own files — mirroring how
255+ (`/app/config`), bind-mounts a per-service host log directory
256+ (`./logs/api`, `./logs/indexer` → `/app/logs`) with `LOG_DIR=/app/logs` set,
257+ and defaults `APP_CONFIG` to the `*.local.yaml` files. Add an override that
258+ points `APP_CONFIG` at your own files — mirroring how
257259` docker-compose.stage.yml` selects the Supabase configs.
258260
259261Create `docker-compose.prod.yml` :
@@ -327,12 +329,30 @@ docker compose -f docker-compose.yml -f docker-compose.prod.yml kill -s SIGUSR1
327329
328330# ## Logs
329331
332+ Each service writes to **both** stdout and a host-mounted directory. The base
333+ ` docker-compose.yml` bind-mounts `./logs/api` and `./logs/indexer` (on the host)
334+ to `/app/logs` (in each container) and sets `LOG_DIR=/app/logs`. With `LOG_DIR`
335+ set, the service writes daily-rotated, human-readable files named
336+ ` <service>.log.<YYYY-MM-DD>` into that directory, keeping at most `LOG_MAX_FILES`
337+ of them (default 14) :
338+
330339` ` ` sh
340+ # tail the live stdout stream (unchanged)
331341docker compose -f docker-compose.yml -f docker-compose.prod.yml logs -f api indexer
342+
343+ # the persisted files on the host (survive container removal / redeploy)
344+ tail -f logs/api/api.log.*
345+ ls -1 logs/indexer/
332346` ` `
333347
334- Log verbosity is controlled by `RUST_LOG` (set in the override) and
335- ` app.log_level` in config.
348+ Notes :
349+
350+ - The containers run as `root`, so files under `logs/` are root-owned — use
351+ ` sudo` to read/rotate them as a non-root user.
352+ - ` LOG_DIR` and `LOG_MAX_FILES` are environment variables (there is no YAML
353+ config key). Unset `LOG_DIR` to disable file logging and keep stdout only.
354+ - Verbosity is still controlled by `RUST_LOG` (set in the override) and
355+ ` app.log_level` in config; the same filter applies to stdout and files.
336356
337357# ## Upgrades
338358
0 commit comments