Variables in Compose, the Right Way
Labs have no container engine, so nothing is started: your files are checked with docker-compose config.
/home/student/projects/checkout-web/compose.yaml has the database password written into it twice, always deploys latest, and mixes app settings into the file.
api image tag comes from the variable TAG, defaulting to stable when it's unset or empty.DB_PASSWORD, used for both POSTGRES_PASSWORD and inside DATABASE_URL. When DB_PASSWORD is unset or empty, docker compose config (and up) must fail with an error. Don't store the password in the project directory (no .env with it).LOG_LEVEL=info and FEATURE_FLAGS=search,export move out of compose.yaml into a file api.env that the api service loads.changeme must not appear in compose.yaml anymore.About 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.
Part of Docker Fundamentals. Next step: Graceful Shutdown in Compose
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.