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
56 changes: 33 additions & 23 deletions answers.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,57 @@
# Answers

Nom:
Prénom:
NB:
Nom: Monomakhoff
Prénom: Victor
NB: 1

## 1.3
command:
command: docker run tp2_back

## 1.4
answer:
command:
answer: Le port 8080 est fermé :/
command: docker run -p 8080:8080 -e ENVIRONMENT=back tp2_back

## 1.5
command:
command: ENVIRONMENT=back

## 1.6
answer:
command:
answer: An image does not exist locally with the tag: vmonomakhoff/tp2
command: docker images
docker tag b84636daa55d vmonomakhoff/tp2

## 1.7
answer:
command:
command:
command:
answer: L'image est pull avant que l'image redémarre
command: docker rmi -f $(docker images -q)
command: docker run -p 8080:8080 -e ENVIRONMENT=back vmonomakhoff/tp2
command: docker run -p 8080:8080 -e ENVIRONMENT=back -d vmonomakhoff/tp2

## 1.8
answer:
command:
command:
answer: zealous_bhabha
command: docker ps
command: docker rename zealous_bhabha TP2Back
docker restart TP2Back

## 1.9
answer:
answer:
answer: docker exec -it TP2Back cat /etc/*release
answer: docPRETTY_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:
answer:
command: docker run -p 8081:8081 -e APP_PORT=8081 -e WS_BACK_URL=172.17.0.1 -d vmonomakhoff/tp2_f
answer: With path : toto (from URL path)

## 2.1
command:
command: docker-compose run tp2

## 2.6
command:
command:
command: docker-compose run -d back
command: docker-compose run -d front


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

WORKDIR /tp2/app/back

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

COPY . .

CMD [ "python", "-u", "./webservice.py" ]
34 changes: 34 additions & 0 deletions app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "3"

services:
back:
image: vmonomakhoff/tp2
deploy:
replicas: 5
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
expose:
- "8080:8080"
environment :
- ENVIRONMENT=back

front:
image: vmonomakhoff/tp2_f
deploy:
replicas: 5
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
ports:
- "8081:8081"
environment :
- APP_PORT=8081
- WS_BACK_URL=172.17.0.1

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

WORKDIR /tp2/app/front

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

COPY . .

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