Final Project: Containerize a Web App
Time to package a real application with Docker.
Requirements
- Write a
Dockerfilefor an existing app of yours (or a simple new one), ordering instructions so dependency installation is cached separately from your source code. - Build the image and run it as a container, confirm it works by accessing it from your browser or a REST client.
- Add a second service the app depends on (a database, cache, etc.) using a
docker-compose.ymlfile. - Use a named volume so that service's data survives
docker compose downanddocker compose upagain. - Pass at least one piece of configuration in via an environment variable rather than hardcoding it.
Stretch goals
- Add a
.dockerignorefile to keepnode_modules/.git/etc. out of your image. - Use a multi-stage build to keep the final image small.
- Push your image to Docker Hub.
Submit your repository link below when you are done, an instructor will review it before you can mark this lesson complete. Good luck! 🚀