Giter Club home page Giter Club logo

mini-projet-docker's Introduction

mini-projet-docker

Please find the specifications by clicking Here

Firstname : BAH

Surname : MAMADOU ALPHA

For Eazytraining's 17th DevOps Bootcamp

Period : march-april-may

Sunday the 14th, Janaury 2024

THE GOAL of this Mini-Project :

the goal of this project is to embed an application in a docker container. The project has three main parts:

1- BUILd : this involves writing a Dockerfile with the instructions given in the statement, and testing the application with a "CURL" command provided in the statement, which is supplied with identifiers.

2- IAC : set up the automation part with the As Code infrastructure using Docker compose (this tool enables us to automatize our containerized application).

3- Registry: In this part, we're asked to create a private Registry to store our own images.

4- IHM of the Registry: Here we could consult our own images that we've uploaded to our private registry

Translated with DeepL.com (free version)

I had to deploy an application named "student_list", which is very basic and enables POZOS to show the list of some students with their age. student_list application has two modules: The first module is a REST API (with basic authentication needed) who send the desire list of the student based on JSON file The second module is a web app written in HTML + PHP who enable end-user to get a list of student

DESING STUDENT-LIST PROJECT

ARCHI

The Explain the architecture of POZOS application:

My plan

First, let me introduce you the six files of this project and their role

Then, I'll show you how I built and tested the architecture to justify my choices

Third and last part will be about to provide the deployment process I suggest for this application. The files' role

In my delivery you can find three main files : a Dockerfile, a docker-compose.yml and a docker-compose.registry.yml

docker-compose.yml: to launch the application (API and web app)
docker-compose.registry.yml: to launch the local registry and its frontend
simple_api/student_age.py: contains the source code of the API in python
simple_api/Dockerfile: to build the API image with the source code in it
simple_api/student_age.json: contains student name with age on JSON format
index.php: PHP  page where end-user will be connected to interact with the service to list students with their age.

Build and test

Considering you just have cloned this repository, you have to follow those steps to get the 'student_list' application ready :

1- Change directory and build the api container image :

Capture

Images-Docker-images-POZO

2- Create a bridge-type network for the two containers to be able to contact each other by their names thanks to dns functions :

NetworkPNG

We double Ckeck if the network is create

check network

3- Move back to the root dir of the project and run the backend api container with those arguments :

cd .. docker run -d --network pozos --name test-api-pozos -v ${PWD}/student_age.json:/data/student_age.json -p 4000:5000 api-pozos:v1 Here the port 4000 of the VM "Eazytraining" will forward by the port 5000 of our container "test-api"

container

4- Test the api through the frontend : Using command line :

The next command will ask the frontend container to request the backend api and show you the output back. The goal is to test both if the api works and if frontend can get the student list from it.

list-student

I'm using the hostname IP "127.0.0.1" beacause i'm in localy. my application which responds from the "student_age.json" script" giving me the list of students and their ages.

localhost

so far I'm validating the Build and Test part of my muni docker project.

Infrastructure As Code

we need to set up a docker compose that will allow us to automate the deployment of our infrastructure. The goal is to create a second "website" container with the required recommendations.

Let me remove the test container and the test network before to lauch the automatic scritp to provisonne my cinfrastructure via "Docker compose" docker delete

network-delete

let build the docker-compose file with the following comand to create the network and both containerthe website and the api :

docker-compose up -d Docker-copose

ne

We try to test, if we can reach our website via the port of the Eazytraining VM. port

We cannot see the list of the student because we don't fill the folow parameters "(http://<api_ip_or_name:port>/pozos/api/v1.0/get_student_ages)"

check

let fix it, we have to go in the follow path "website/index.php"

numport

fixed

I fixed because i change my Docker-compose file to include the parameter "container_name" sto have the resolution DNS beteween the containers.

liste-student

Docker Registry

We will create here a registry, wich help use to store our images.

mini-projet-docker's People

Contributors

bahalphaone avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.