Céline LIU & Laura LLINARES
Create a calculator container that connects to a mongodb which runs on another container, fetches data and shows it on a webpage on your host machine.
Add to your application a feature, which adds the images on your host and loads it on a web page. Any changes in this folder should be shown by refreshing the web page. (by using a bind mount)
Be sure to have docker and docker compose installed, check with
docker --version
docker-compose --version
And then clone it, go to the directory with:
git clone [email protected]:<your_github_username>/<project-name>.git
cd <project-name>
You can also pull the image from the Docker Hub repository
docker pull laurall974/calculator-app
- Pull the docker images (mongo)
docker pull mongo
It will pull the latest version as the default one without giving a tag, if you dont have it already.
- Create a bridge network for the containers to connect to!
docker network create --driver bridge <your_bridge_network_name>
- Start the MongoDB container by specifying the network and the port
docker run -d --network <your_bridge_network_name> --name <your_mongo_container_name> -p 27017 mongo
- Build the Docker image for the Flask application
docker build -t <your_new_image_name> .
- Create the docker Volume
docker volume create <your_volume_name>
- Start the Calculator container, specifying the network, bind mount, volume
docker run -d
--network <your_bridge_network_name>
--name <your_new_container_name>
-p 8080:8080
-v /path_to_your_directory/<project-name>/Pictures:/app/images <your_new_image_name>
-v <your_volume_name>:/data/db mongo
Use the command
docker compose up -d
The list of calculations is available on http://localhost:8080 for the Dockerfile
and . http://localhost:8080 for docker-compose.yml
.
Any changes in the Pictures folder's image will be shown by refreshing the web page http://localhost:8080.
You can also verify mounts :
docker inspect <your_mongo_container_name>
Your Project should have:
✔️ At least two containers, one being a database of your choice
✔️ At least one well-documented Dockerfile and docker-compose.yml (with comments)
✔️ A volume to make your database persistent and also a bind mount
✔️ An explicit bridge network for the communications of your containers
✔️ A Docker Hub public repository for your docker images
✔️ A GitHub repository with instructions to run your project (The collaboration of both contributors should be visible)
✔️ At least a dependency requiring the installation of an external library/package
✔️ Both teammates should explain the technical architecture and how they have collaborated
✔️ Your presentation skills are also evaluated (5 pts) the precision and the accuracy of your words are important
✔️ During this presentation you should demonstrate your knowledge of all keys concepts seen in this course
✔️ You are asked to use a medium for your presentation (PowerPoint)
✔️ The language is English (Non-negotiable)