From fd16885025d1255c107d66952f6341776b04ed44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Piovesan?= Date: Thu, 8 Nov 2018 12:34:52 +0100 Subject: [PATCH 1/4] Step 1.0 add name and first name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Clément Piovesan --- answers.md | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/answers.md b/answers.md index defa8e2..5dad115 100644 --- a/answers.md +++ b/answers.md @@ -1,47 +1,45 @@ # Answers -Nom: -Prénom: -NB: +Nom: PIOVESAN +Prénom: Clément +NB: 2 ## 1.3 -command: +command: ## 1.4 answer: -command: +command: ## 1.5 -command: +command: ## 1.6 answer: -command: +command: ## 1.7 answer: -command: -command: -command: +command: +command: +command: ## 1.8 answer: -command: -command: +command: +command: ## 1.9 answer: answer: ## 1.11 -command: +command: answer: ## 2.1 -command: +command: ## 2.6 -command: -command: - - +command: +command: From 185ac7c0d8695e8bf94069e53daa620850599a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Piovesan?= Date: Mon, 12 Nov 2018 12:26:53 +0100 Subject: [PATCH 2/4] Part 1 of tp2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Clément Piovesan --- answers.md | 48 +++++++++++++++++++++++++++++--------------- app/back/Dockerfile | 11 ++++++++++ app/front/Dockerfile | 11 ++++++++++ 3 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 app/back/Dockerfile create mode 100644 app/front/Dockerfile diff --git a/answers.md b/answers.md index 5dad115..ce6772b 100644 --- a/answers.md +++ b/answers.md @@ -5,37 +5,53 @@ Prénom: Clément NB: 2 ## 1.3 -command: +command: docker build -t cpiovesan/tp2 . + docker run -it --rm --name my-running-app my-python-app ## 1.4 -answer: -command: +answer: L'addresse ne répond car nous avons pas autorisé la connection au port 8080 +command: docker run -it --rm --name my-running-app -p 8080:8080/tcp -p 8080:8080/udp my-python-app ## 1.5 -command: +command: docker run -it --rm --name my-running-app -p 8080:8080/tcp -p 8080:8080/udp -e ENVIRONMENT=python:3-alpine my-python-app ## 1.6 -answer: -command: +answer: Il faut changer le nom de son appli et le remplacer par le nom de son dépot Docker Hub (cpiovesan/tp2 dans mon cas) +command: docker login (login dans docker hub) + docker images (pour trouver l'id de mon image) + docker tag 5868e2a4e118 cpiovesan/tp2 (tag mon appli docker vers son id docker hub) + docker push cpiovesan/tp2 (push mon appli vers docker hub) ## 1.7 -answer: -command: -command: -command: +answer:d +command: docker rmi -f XXXXXXX (id de l'image) +command: docker run -it --rm --name my-running-app -p 8080:8080/tcp -p 8080:8080/udp -e ENVIRONMENT=python:3-alpine cpiovesan/tp2 +command: docker run -it --rm --name my-running-app -p 8080:8080/tcp -p 8080:8080/udp -e ENVIRONMENT=python:3-alpine -d cpiovesan/tp2 ## 1.8 answer: -command: -command: +command: docker ps (nom de mon container: my-running-app, id: 8898504301e4) +command: docker container rename my-running-app tp2container + docker restart 8898504301e4 ## 1.9 -answer: -answer: +answer: docker exec -i -t 8199a0b3a0bf cat /etc/*release +answer: Il montre que nous utilisons l'OS Alpine Linux +answer: NAME="Alpine Linux" + ID=alpine + VERSION_ID=3.8.1 + PRETTY_NAME="Alpine Linux v3.8" + HOME_URL="http://alpinelinux.org" + BUG_REPORT_URL="http://bugs.alpinelinux.org" + ## 1.11 -command: -answer: +command: docker run -it --rm -p 8081:8081 -e APP_PORT=8081 -e WS_BACK_URL=172.20.10.3 cpiovesan/tp2front +answer: You called at : 2018-11-08 13:50:20.982599 (dynamic) + On environment : python:3-alpine (from env variable) + With path : write (from URL path) + With front : 3cc71ce7cc48 (from real hostname of front service) + With back : 96c81aa0efee (from real hostname of back service) ## 2.1 command: diff --git a/app/back/Dockerfile b/app/back/Dockerfile new file mode 100644 index 0000000..6b2b58d --- /dev/null +++ b/app/back/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3-alpine + +WORKDIR /Users/cpiovesan/Documents/ECE/ING5/Microservices/tp2/ + +COPY . . + +RUN pip install --no-cache-dir -r requirements.txt + +RUN mkdir logs + +CMD [ "python", "-u", "./webservice.py" ] diff --git a/app/front/Dockerfile b/app/front/Dockerfile new file mode 100644 index 0000000..a02196a --- /dev/null +++ b/app/front/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3-alpine + +WORKDIR /Users/cpiovesan/Documents/ECE/ING5/Microservices/tp2/front + +COPY . . + +RUN pip install --no-cache-dir -r requirements.txt + +RUN mkdir logs + +CMD [ "python", "-u", "./front.py" ] From 21a0cb501e3bb390598da165ae5302a5b23e0e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Piovesan?= Date: Mon, 12 Nov 2018 13:33:00 +0100 Subject: [PATCH 3/4] Part of part 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Clément Piovesan --- answers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/answers.md b/answers.md index ce6772b..f41cc00 100644 --- a/answers.md +++ b/answers.md @@ -54,7 +54,7 @@ answer: You called at : 2018-11-08 13:50:20.982599 (dynamic) With back : 96c81aa0efee (from real hostname of back service) ## 2.1 -command: +command: docker-compose up ## 2.6 command: From 36df5e09647559f328feaa74fdc8d02c252e8174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Piovesan?= Date: Wed, 21 Nov 2018 21:01:19 +0100 Subject: [PATCH 4/4] Answers to 2.5 through the end of part 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Clément Piovesan --- answers.md | 4 ++-- app/docker-compose.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/answers.md b/answers.md index 24af5ab..3209e94 100644 --- a/answers.md +++ b/answers.md @@ -13,7 +13,7 @@ answer: L'addresse ne répond car nous avons pas autorisé la connection au port command: docker run -it --rm --name my-running-app -p 8080:8080/tcp -p 8080:8080/udp my-python-app ## 1.5 -command: docker run -it --rm --name my-running-app -p 8080:8080/tcp -p 8080:8080/udp -e ENVIRONMENT=python:3-alpine my-python-app +command: docker run -it --rm --name my-running-app -p 8080:8080/tcp -p 8080:8080/udp -e ENVIRONMENT=dev my-python-app ## 1.6 answer: Il faut changer le nom de son appli et le remplacer par le nom de son dépot Docker Hub (cpiovesan/tp2 dans mon cas) @@ -61,4 +61,4 @@ command: docker-compose up -d command: docker-compose logs ## 2.9: -command: +command: docker-compose up --scale back-service=2 diff --git a/app/docker-compose.yml b/app/docker-compose.yml index 7315761..2511b36 100644 --- a/app/docker-compose.yml +++ b/app/docker-compose.yml @@ -1,15 +1,15 @@ version: '3' services: back-service: - ports: - - "8080:8080" environment: - - ENVIRONMENT=python:3-alpine + - ENVIRONMENT=dev image: cpiovesan/tp2back front-service: ports: - "8081:8081" environment: - APP_PORT=8081 - - WS_BACK_URL=172.20.10.2 + - WS_BACK_URL=backend image: cpiovesan/tp2front + links: + - "back-service:backend"