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
68 changes: 46 additions & 22 deletions answers.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,72 @@
# Answers
# Answers

Nom:
Prénom:
NB:
Nom: Ong
Prénom: Philippe
NB: 6

## 1.3
command:
docker build -t tp2back .
docker run tp2back

## 1.4
answer:
command:
answer: Nous n'avons pas ouvert le port 8080 pour accéder au service.
command: docker run -p 8080:8080 tp2back

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

## 1.6
answer:
answer: Il est nécessaire d'ajouter un tag à notre image avant de push
command:
docker tag e58e15377c01 ongphil/tp2back
docker push ongphil/tp2back

## 1.7
answer:
command:
command:
command:
answer: L'image n'existe pas localement puisqu'on l'a supprimé. Il faut essayer de récupérer l'image de notre repo en ajoutant notre nom d'utilisateur : ongphil/tp2back
command: docker rmi -f $(docker images -q)
command: docker run -p 8080:8080 -e ENVIRONMENT=dev ongphil/tp2back
command: docker run -p 8080:8080 -e ENVIRONMENT=dev -d ongphil/tp2back

## 1.8
answer:
command:
command:
answer: En lançant en mode détaché, notre back est toujours fonctionnel même si on ferme le terminal.
Le nom du contenur est relaxed_turing
command: docker ps
command: docker rename relaxed_turing detached_tp2back

## 1.9
answer:
answer:
Pour ouvrir une session interactive et afficher les informations sur l'OS :
docker exec -i detached_tp2back bash
cat /etc/*release
answer: l'OS utilisé est Debian GNU/Linux 9 (stretch).
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 -p 8081:8081 -e APP_PORT=8081 -e WS_BACK_URL=172.17.0.1 ongphil/tp2front
answer:
http://localhost:8081/philippe
You called at : 2018-11-09 13:39:23.380670 (dynamic)
On environment : dev (from env variable)s
With path : philippe (from URL path)
With front : 4615afcaacdf (from real hostname of front service)
With back : abe9cad70252 (from real hostname of back service)

## 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 tp2back=2

13 changes: 13 additions & 0 deletions app/back/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3

WORKDIR /usr/src/app/back

COPY requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

RUN mkdir logs

CMD ["python", "-u", "./webservice.py"]
20 changes: 20 additions & 0 deletions app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3'
services:
tp2back:
image: ongphil/tp2back
environment:
- ENVIRONMENT=dev
#volumes:
#- logs
tp2front:
image: ongphil/tp2front
ports:
- "8081:8081"
environment:
- APP_PORT=8081
- WS_BACK_URL=back
links:
- "tp2back:back"

#volumes:
#logs:
11 changes: 11 additions & 0 deletions app/front/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3

WORKDIR /usr/src/app/front

COPY requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD ["python", "-u", "./front.py"]
Loading