Docker Compose: startup, networking and configuration
Compose is easy until the container starts and behaves differently from the file. The entries here cover the four places where that happens most often: startup order (the app connects before Postgres accepts connections), networking (a published port that bypasses the firewall), configuration (a .env change the running container never sees) and data (a backup nobody ever restored). Every blueprint gives the command that reproduces the problem and the command that proves the fix — the value inside the container, not the value in the file.
Startup and configuration
-
Compose does not wait for PostgreSQL
Explains how to configure Docker Compose to ensure an app container waits for PostgreSQL to be fully ready using a TCP healthcheck and `service_healthy` condition.
-
Compose ignores changed .env values
Docker Compose containers do not automatically pick up changes in .env files. Use 'docker compose up -d --force-recreate <service>' to ensure updates. Verify values with 'docker inspect <container> --format '{{range .Config.Env}}{{println .}}{{end}}' | grep <VAR>'. Exported shell variables can override .env values.
-
Open WebUI: external OpenAPI tool
Guide to fixing Open WebUI Docker setup for external OpenAPI tool calls with local Ollama model, addressing spec URL, security, and context issues.
Network and exposure
-
Docker port reachable despite UFW
Solution to block Docker container ports exposed to the internet while keeping UFW and iptables active, by adding rules to DOCKER-USER chain.
Backups
-
Nightly backup pipeline for a Docker stack
Instructions for setting up a verified and monitored nightly backup pipeline for Dockerized Postgres and Qdrant using systemd timers.
Other topics: PostgreSQL constraints, triggers and vector search · Home Assistant: entities, automations and device states