diff --git a/answers.md b/answers.md index 25c43e4..6456c3f 100644 --- a/answers.md +++ b/answers.md @@ -1,46 +1,58 @@ # Answers -Nom: -Prénom: -NB: +Nom: Vuong +Prénom: Lisa +NB: 3 ## 1.3 command: +docker build -t img . +docker run img ## 1.4 -answer: -command: +answer: car les ports ne sont pas ouverts +command: docker run -p 8080:8080 img ## 1.5 -command: +command: docker run -e ENVIRONMENT=dev -p 8080:8080 img ## 1.6 -answer: -command: - +answer: car le nom de l'image n'est pas bon +command: docker tag img lisav/img:0.1 --> docker push lisav/img:0.1 + ## 1.7 -answer: -command: -command: -command: +command: sudo docker rmi -f $(docker images -q) +answer: l'image est "pull" du repository docker lisav/img comme il ne le trouve pas localement +command: docker run -e ENVIRONMENT=dev -p 8080:8080 lisav/img +command: docker run -d -e ENVIRONMENT=dev -p 8080:8080 lisav/img ## 1.8 -answer: -command: -command: +answer: name = ecstatic_mcnulty and container id = d4fb6f40aa9a. +command: docker ps OU docker container ls +command: docker rename ecstatic_mcnulty realcontainersname ## 1.9 +answer: L'OS utilisé est Debian GNU/Linux 9. answer: -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 WS_BACK_URL=172.17.0.1 -e APP_PORT=8081 front +answer:pour le back, ce qui change est : "result": "path_test" + pour le front, ce qui change est : With path : path_test (from URL path) ## 2.1 -command: +command: docker-compose up ## 2.6 -command: -command: +command: docker-compose up -d +command: docker-compose logs -f diff --git a/app/back/Dockerfile b/app/back/Dockerfile new file mode 100644 index 0000000..b91bd52 --- /dev/null +++ b/app/back/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.7.1-stretch + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD [ "python", "-u", "./webservice.py" ] + diff --git a/app/back/docker b/app/back/docker new file mode 100644 index 0000000..e69de29 diff --git a/app/docker-compose.yml b/app/docker-compose.yml new file mode 100644 index 0000000..2484881 --- /dev/null +++ b/app/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3' +services: + back: + image: a99d471b3ab1 + ports: + - "8080:8080" + environment: + - ENVIRONMENT=dev + front: + image: a38dcb68fd6e + ports: + - "8081:8081" + environment: + - APP_PORT=8081 + - WS_BACK_URL=172.17.0.1 diff --git a/app/front/Dockerfile b/app/front/Dockerfile new file mode 100644 index 0000000..e8d3eee --- /dev/null +++ b/app/front/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.7.1-stretch + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD [ "python", "-u", "./front.py" ] + +VOLUME app/logs diff --git a/app/front/docker b/app/front/docker new file mode 100644 index 0000000..e69de29