Skip to content
$ lynuxpro
← All projects

DOCKER PROJECT · ABOUT 40 MIN · +150 XP

Containerise a two-tier app

The team wants the shop's front end and its database running in containers on one host, talking over a private network, with the database's data safe if the container is replaced.

Your tasks

  1. Create ~/shopweb with an index.html (any text) and a Dockerfile that starts FROM nginx:1.27 and copies index.html into /usr/share/nginx/html/.
  2. Build it as the image shopweb:1.0.
  3. Create a network called shopnet and a volume called shopdb.
  4. Run postgres:17 in the background as db on shopnet, with shopdb mounted at /var/lib/postgresql/data.
  5. Run shopweb:1.0 in the background as web on shopnet, publishing host port 8080 to container port 80.

Stuck? Every step is covered in the Docker lessons.

Sign in to start this project

Your progress is checked and saved to your profile.

Sign in