Server mode is controlled through .env.
Example:
APP_ENV=dev
APP_PORT=8000
API_TOKEN=your-token
LOKI_PORT=3100
GRAFANA_PORT=3000
GRAFANA_ADMIN_USER=admin
GRAFANA_ADMIN_PASSWORD=adminValues:
APP_ENV=dev- startsuvicornwith--reload, and code changes inapi/are applied automatically.APP_ENV=prod- starts the server without auto-reload.
The Docker stack includes Loki, Grafana, and Alloy.
Alloyreads container logs from Docker and ships them toLoki.Grafanais provisioned withLokias the default datasource.Grafanapreinstalls thegrafana-lokiexplore-appplugin required forLogs Drilldown.- Application logs already go to
stdout, soapiandirislogs appear inLokiautomatically. - Loki is configured with
volume_enabled: true, which is required for GrafanaLogs Drilldown.
After startup:
- Grafana:
http://localhost:${GRAFANA_PORT} - Loki:
http://localhost:${LOKI_PORT}
Open Grafana and query logs by labels such as service, container, and stream.
In Logs Drilldown, logs should appear grouped by service_name for each Compose service/container.