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

Nom:
Prénom:
NB:
Nom: FOLLY
Prénom: Roch
NB: 5

## 1.3
command:
command: docker build -t tp2 back
command: docker run tp2

## 1.4
answer:
command:
answer: Nous n'avons ouvert aucun port 8080 pour accéder à l'image Docker.
command: docker run -p 8080:8080 tp2 back

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

## 1.6
answer:
command:
answer: Il faut taguer l'image avant de pouvoir la push
command: docker tag c4a3d2e51af7 rochfolly/tp2
command : docker push rochfolly/tp2

## 1.7
answer:
command:
command:
command:
answer: Après avoir supprimé toutes les images, elles n'existement logiquement plus localement. Lorsqu'on essaye de la lancer à nouveau, l'image est pulled avant de démarrer.
command: docker rmi -f $(docker images -q)
command: docker run -p 8080:8080 -e ENVIRONMENT=dev rochfolly/tp2
command: docker run -p 8080:8080 -e ENVIRONMENT=dev -d rochfolly/tp2

## 1.8
answer:
command:
command:
answer: On peut vérifier que le container est bien démarré en regardant si il fonctionne avec le terminal fermé. C'est le cas, et son nom est kind_mclaren.
command: docker ps
command: docker rename kind_mclaren detached_tp2

## 1.9
answer:
answer:
answer: docker exec -i detached_tp2 cat /etc/*release
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 -d rochfolly/tp2front
url: http://localhost:8081/roch
sortie: You called at : 2018-11-26 14:48:05.292152 (dynamic)
On environment : dev (from env variable)
With path : roch (from URL path)
With front : 4986f7af069d (from real hostname of front service)
With back : c354fa1ccd0a (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


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

WORKDIR /usr/src/app/back

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

COPY . .

CMD [ "python", "-u", "./webservice.py" ]
17 changes: 17 additions & 0 deletions app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
services:
tp2back:
image: rochfolly/tp2
environment:
- ENVIRONMENT=dev

tp2front:
image: rochfolly/tp2front
ports:
- "8081:8081"
environment:
- APP_PORT=8081
- WS_BACK_URL=back
links:
- "tp2back:back"

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"]