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
- 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/.
- Build it as the image shopweb:1.0.
- Create a network called shopnet and a volume called shopdb.
- Run postgres:17 in the background as db on shopnet, with shopdb mounted at /var/lib/postgresql/data.
- 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.