Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 40 additions & 24 deletions answers.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,64 @@
# Answers

Nom:
Prénom:
NB:
Nom: Benguigui
Prénom: Thomas
NB: Groupe 3

## 1.3
command:
command: docker run tp2
On a créé l'image docker avec "docker build -t tp2 ./"

## 1.4
answer:
command:
answer: La machine n'autorise pas la connexion car les ports sont fermés.
command: docker run -p 8080:8080 tp2

## 1.5
command:
command: docker run -p 8080:8080 -e ENVIRONMENT=dev tp2

## 1.6
answer:
command:
answer: L'image n'a pas un nom qui correspond à celui du repo docker.
command: docker tag tp2 tombenpotter/microservices-tp2:0.1
docker push tombenpotter/microservices-tp2:0.1

## 1.7
answer:
command:
command:
command:
answer: L'image n'est pas trouvée localement, donc docker va la télécharger sur le hub avant de la lancer.
command: docker rmi $(docker images -q)
command: docker run -p 8080:8080 -e ENVIRONMENT=dev tombenpotter/tp2:0.1
command: docker run -d -p 8080:8080 -e ENVIRONMENT=dev tombenpotter/tp2:0.1

## 1.8
answer:
command:
command:
answer: Il faut utiliser la commande ci-dessous, car le container est en mode détaché. Le nom du container est : 2049f02f297b
command: docker ps -a
command: docker rename [id] back

## 1.9
answer:
answer:
answer: docker exec -it back bash
answer: PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

## 1.11
command:
command: docker run -d -p 1010:1010 -e APP_PORT=1010 -e WS_BACK_URL=172.17.0.1 tombenpotter/microservices-tp2-front
answer: You called at : 2018-11-11 22:03:42.533379 (dynamic)
On environment : dev (from env variable)
With path : test (from URL path)
With front : 1a27478114c6 (from real hostname of front service)
With back : 018cde991272 (from real hostname of back service)

## 1.11 bis
command: docker exec -it [back_container_id] bash

## 2.1
command:
command: docker-compose up

## 2.6
command:
command:
command: docker-compose up -d
command: docker-compose logs

## 2.9
command:

command: docker-compose up -d --scale service-back=2
10 changes: 10 additions & 0 deletions app/back/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.7.1-stretch

COPY requirements.txt ./

RUN pip install -r requirements.txt
RUN mkdir logs

COPY . .

CMD ["python", "-u", "./webservice.py"]
18 changes: 18 additions & 0 deletions app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version : '3'
services:
service-back:
image: tombenpotter/microservices-tp2:0.1
environment:
- ENVIRONMENT=dev
# volumes:
# - "./logs:/logs"

service-front:
image: tombenpotter/microservices-tp2-front:0.1
ports:
- "1010:1010"
environment:
- APP_PORT=1010
- WS_BACK_URL=backend
links:
- "service-back:backend"
10 changes: 10 additions & 0 deletions app/front/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.7.1-stretch

COPY requirements.txt ./

RUN pip install -r requirements.txt
RUN mkdir logs

COPY . .

CMD ["python", "-u", "./front.py"]
3 changes: 3 additions & 0 deletions app/logs/my-messages.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
salut
salut
salut