Linux Labs

Containers: Docker and compose / Final lab

A compose stack after the move

hard ~40 min
Not running Starting usually ~20 s
Report a problem

Situation

The shop orders service, the backend application with nginx in front of it as proxy, used to be started by hand with docker run commands. The orders have been kept in a Docker volume ever since. A colleague described the service in ~/shop/compose.yaml (with proxy.conf, the nginx configuration, next to it), removed the old containers and ran sudo docker compose up -d in ~/shop. The stack did not come up, and the colleague's shift is over.

The service must answer on port 8080 of this machine. Run docker commands with sudo: the student user has no direct access to Docker. The files in ~/shop are yours, you can edit them without sudo. The machine has no internet access; the nginx:alpine and shop-backend:1.0 images are already here.

Task

  1. The stack from ~/shop/compose.yaml is up via docker compose: proxy is running, backend passes its health check (healthy), and neither of them keeps restarting.
  2. curl http://localhost:8080/ gets code 200 and the order list from proxy.
  3. backend shows the orders from the volume that held them before the move to compose, and the existing orders are intact.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 3
  • The stack from ~/shop/compose.yaml is up via docker compose — proxy is running, backend is healthy, neither keeps restarting — not checked yet
  • curl http://localhost:8080/ gets code 200 and the order list from proxy — not checked yet
  • backend shows the orders from the volume that held them before compose, and the existing orders are intact — not checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…