Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion deploy/motis/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ fi

while :; do
log "starting server on $CURRENT"
/motis server -d "$CURRENT" &
# --log-level info, not MOTIS's default debug. The GTFS-RT feed carries every
# bus in the country while the static datasets are rail only, so nearly every
# trip in it is unresolvable by construction and MOTIS logged a debug line
# per trip, every update_interval. Measured on the droplet: 19,995 of any
# 20,000 lines were that one message, 1.5 GB an hour, and on 2026-09-18 it
# filled the 77 GB disk. The [info] lines (rt update timings) are kept.
/motis server -d "$CURRENT" --log-level "${MOTIS_LOG_LEVEL:-info}" &
pid=$!
swap=0
while kill -0 "$pid" 2>/dev/null; do
Expand Down
34 changes: 34 additions & 0 deletions docker-compose.cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ services:
app:
condition: service_healthy
restart: unless-stopped
# Docker's json-file driver is unbounded by default. On 2026-09-18 MOTIS's
# debug log reached 32 GB and filled the droplet's 77 GB disk: every
# container went unhealthy, Postgres could not write, and a deploy failed
# at the scp step because nothing could be written to /tmp. Caps here, on
# every service, so one chatty container cannot do that again.
logging:
driver: json-file
options:
max-size: "50m"
max-file: "5"

# NestJS Backend + Next.js Frontend (single container)
app:
Expand Down Expand Up @@ -131,6 +141,11 @@ services:
# start_period elapses it still goes unhealthy and the deploy fails for real.
start_period: 180s
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "50m"
max-file: "5"

# PostgreSQL Database
postgres:
Expand All @@ -148,6 +163,11 @@ services:
timeout: 3s
retries: 5
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "50m"
max-file: "5"

# Redis Cache — caching & rate limiting
redis:
Expand All @@ -161,6 +181,11 @@ services:
timeout: 3s
retries: 5
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "50m"
max-file: "5"

# MOTIS — routing engine behind the Deutsche Bahn connector, fed by the open
# gtfs.de timetable (CC BY 4.0) plus its GTFS-RT feed for live delays.
Expand All @@ -183,6 +208,10 @@ services:
- motis_data:/data
environment:
- MOTIS_REFRESH_DAYS=${MOTIS_REFRESH_DAYS:-7}
# info, not MOTIS's default debug — see deploy/motis/entrypoint.sh.
# Set to debug temporarily when diagnosing a routing problem, then
# put it back: debug writes ~1.5 GB an hour.
- MOTIS_LOG_LEVEL=${MOTIS_LOG_LEVEL:-info}
healthcheck:
# 127.0.0.1, not localhost: MOTIS binds IPv4 only and localhost resolves
# to ::1 first inside the container, so the probe was refused every time.
Expand All @@ -197,6 +226,11 @@ services:
# minutes); the margin is for a slow gtfs.de.
start_period: 180s
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "50m"
max-file: "5"

volumes:
postgres_data:
Expand Down
Loading