The goal of this project is to containerize 1 web app and 1 API + custom private repository for Docker images.
Client: HTML, CSS
Server: Python, Flask
The first step was to build the Docker Image API. To achieve that, I have created a Dockerfile with all the different arguments needed.
This file image installs all the dependencies needed, then installs requirement.txt and runs the ".py" files.
I can test now if the API is working with curl command :
curl -u toto:python -X GET http://<host IP>:<API exposed port>/pozos/api/v1.0/get_student_ages
And this is the response of the curl command :
{
"student_ages": {
"alice": "12",
"bob": "13"
}
}
The first step is completely working!
Our API is operational, so now we need to build the IHM. The IHM needs to be connected to our API, so we do that in the Docker-compose file.
This allowed me to build an IaC, a just simple files we deploy all our services.
The first step is to create the docker-compose file.
After this docker files is OK, I can build it wit htis command :
docker-compose build
And now I can access to the IHM at my serveur IP address :
- @atchuross