A colleague moved the site to docker compose: two containers are described in one file, ~/stack/compose.yaml. The web server proxy takes requests on port 8080 and passes them to the application backend. The colleague brought the stack up with docker compose up -d, which printed no errors, yet the site does not open.
See for yourself. “Start” brings the stack up the way the colleague left it.
Open the stack's site
The stack in ~/stack is up. Open the site on port 8080 and look at the state of the services.
First, predict
docker compose up -d started both containers without errors. What will the first line of the curl -i answer be?
Now start the exercise, run the command and compare your prediction with the output.
What does the (1) in backend's Restarting (1) status mean?
-
The copy number is in the name
stack-backend-1. The brackets in the status hold the exit code of the last run. -
The service has one copy,
stack-backend-1insudo docker compose ps. The brackets hold the exit code. -
The status does not show the restart count —
sudo docker inspect -f '{{.RestartCount}}' stack-backend-1does. The brackets hold the exit code, as inExited (1).
(1) is the exit code of backend's last run: the process ended with an error, and the restart policy starts it again.