A container of mine exits right after it starts. docker ps shows nothing, docker logs shows one line, and the service is simply not there.
I am fairly sure the image is fine — it is a project I have run before on another machine. Here is what I have and have not tried.
docker compose up -d
docker compose logs
The log line is the whole story, and it is not helpful: exited with code 1. No stack trace, no message about the port, nothing about the database.
What I have not done: look at the container that actually ran, since up -d removes nothing but logs only shows the last container. I am guessing the issue is the environment: a variable the README tells you to set that I did not set, and the app exits rather than starting with a default.
Is there a better way to find out than guessing?