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: 37 additions & 24 deletions answers.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,61 @@
# Answers

Nom:
Prénom:
NB:
Nom: TEXIER
Prénom: Hadrien
NB: 2

## 1.3
command:
command: docker build -t my-python-app ./
docker run -it --rm --name my-running-app my-python-app

## 1.4
answer:
command:
answer: Les ports ne sont pas ouverts
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: Le nom de l'image ne correspond au repo il faut donc faire un docker tag
command:docker tag 408808fb1a9e hadtex/dockert2pece
docker push hadtex/dockert2pece


## 1.7
answer:
command:
command:
command:
answer: l'image n'est pas en local donc il la pull
command: docker rmi -f [NUMIMAGE]
command: docker run -it --rm --name my-running-app -p 8080:8080/tcp -p 8080:8080/udp -e ENVIRONMENT=python:3-alpine hadtex/dockert2pece
command: docker run -it --rm --name my-running-app -p 8080:8080/tcp -p 8080:8080/udp -e ENVIRONMENT=python:3-alpine -d hadtex/dockert2pece

## 1.8
answer:
command:
command:
answer: my-ruining-app et id ebcf709953f5
command: docker ps
command: docker rename ebcf709953f5 sens


## 1.9
answer:
answer:
answer: docker exec -it ebcf709953f5 cat /etc/*release
answer: NAME="Alpine Linux"

## 1.11
command:
command: You called at : 2018-11-08 13:50:39.092742 (dynamic)
On environment : python:3-alpine (from env variable)
With path : bonjour (from URL path)
With front : 8b1f466d4822 (from real hostname of front service)
With back : a55d101a7459 (from real hostname of back service
answer: docker run -it --rm --name my-running-app -p 8081:8081/tcp -p 8081:8081/udp -e APP_PORT=8081 -e WS_BACK_URL=172.17.0.1 my-python-app

## 1.11 bis
command: docker exec -it 42790a6aa754 cat logs/my-messages.log

## 2.1
command:
command: docker-compose up

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

## 2.9
command:

## 2.9
command: docker-compose up -d --scale back-service=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-alpine

WORKDIR ./

COPY requirements.txt ./

RUN pip install -r requirements.txt

COPY . .

RUN mkdir logs

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: '2'
services:
back-service:
environment:
- ENVIRONMENT=python:3-alpine
image: hadtex/dockert2pece
# volumes:
# - "./logs:/logs"
front-service:
ports:
- "8081:8081"
environment:
- APP_PORT=8081
- WS_BACK_URL=backend
image: hadtex/fronttp2
links:
- "back-service:backend"
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-alpine

WORKDIR ./

COPY requirements.txt ./

RUN pip install -r requirements.txt

COPY . .

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