The symptom
The container appears briefly after docker compose up, then stops. This is a demonstration scenario, not a report of a verified incident.
Checks to make
- Inspect the container state and exit code with
docker compose ps -a. - Read the first relevant startup error with
docker compose logs --tail=100 app. - Confirm the configured start command and required environment-variable names. Do not print or share their values.
- Confirm the process listens on the expected port and on
0.0.0.0, not only127.0.0.1.
docker compose ps -a
docker compose logs --tail=100 app
Change one hypothesis at a time, restart, and compare the same evidence. A log message that looks plausible is not proof that the underlying issue is fixed.
Scope
The exact cause depends on the image, entrypoint, runtime and application. This note is an illustrative template and must be reproduced against a stated environment before being presented as verified guidance.