Data Lost on Every Recreate
Labs have no container engine, so nothing is started: your files are checked with docker-compose config.
In /home/student/projects/profile/compose.yaml: Postgres refuses to start on some hosts (data directory has wrong ownership), Redis comes back empty after every docker compose up --force-recreate, and the app can overwrite its own configuration.
| Service | Mount |
|---|---|
db | named volume pgdata at /var/lib/postgresql/data |
cache | named volume redisdata at /data |
app | the host directory ./config at /etc/profile, read-only; named volume uploads at /srv/uploads |
backup | the same uploads volume at /backup/uploads, read-only |
Declare the three named volumes at the top level. No other mounts.
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: Limit CPU, Memory and Processes 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.