Start the App Only When the Database Is Ready
Labs have no container engine, so nothing is built or started: your files are checked by reading them, the way a reviewer or a CI linter would. docker-compose config (to validate Compose files) and hadolint (a Dockerfile linter) are installed.
docker compose up on /home/student/projects/auth-api/compose.yaml often fails: web starts before PostgreSQL accepts connections and crashes.
Change compose.yaml so that:
db has a health check running pg_isready -U auth-api every 5s, with a 3s timeout and 10 retriesweb waits until db is healthy before startingweb restarts automatically unless it was stopped by hand (unless-stopped)docker-compose config accepts the fileAbout this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.