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
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:8
COPY lacave.js C:/wamp64/www/Web/lab_0/devops-lab/
RUN npm install express


RUN npm install mysql


ENV MYSQL_HOST=localhost
ENV MYSQL_USER=root
ENV MYSQL_PASSWORD=
ENV MYSQL_DATABASE=project
ENV MYSQL_PORT=3306


EXPOSE 3000


CMD node C:/wamp64/www/Web/lab_0/devops-lab/lacave.js
53 changes: 33 additions & 20 deletions answers.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
# Answers

Lastname:
Firstname:
Lastname:Lacave
Firstname:Gaspard

## 2.2
command:
command:docker run app

## 2.3
question:
command:
question:It could not work before because the app was not linked to any port. We need then to add EXPOSE 3000 in the dockerfile and run the app with a new command listening to this port.
command:docker run -it -p 3000:3000 app

## 2.5
question:
command:
question:We must push the images with the good tag comporting the username first. In addition, we must login just before pushing on docker hub.
command:docker tag f74a0ab9431 gaspardlcv/devops_lab:app
docker login
docker push gaspardlcv/devops_lab

## 2.6
command:
command:docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi -f $(docker images -a -q)

question:
command:
question:We didn't had the image stored on our workplace. But docker succeded to build an image by getting it from our online repository.
It says then "Digest: sha256:9bdc72fd9eda4e336ff673c9c10dd89c77d29956f994534cc78e6d25d3c8be83
Status: Downloaded newer image for gaspardlcv/devops_lab:app".
command:docker run gaspardlcv/devops_lab:app

command:
command:docker run -detach gaspardlcv/devops_lab:app

## 2.7
question:
question:
command:
question:"docker ps" show us the list of running containers. We can find back our newly created containers by comparing its id to the one return when we created it at the previous question.
question:The name is "ecstatic_antonelli".
command:docker ps

command:
command:docker run --name new --detach gaspardlcv/devops_lab:app

## 2.8
question:
output:
question:docker exec new cat /etc/os-release
output:"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/""

## 3.1
command:
command:docker-compose up

## 3.4
command:
command:
command:docker-compose up --detach
command:docker-compose logs
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'
services:
my-service:
ports:
- "3000:3000"
environment:
- MYSQL_HOST=localhost
- MYSQL_USER=root
- MYSQL_PASSWORD=
- MYSQL_DATABSE=project
- MYSQL_PORT=3306
image: gaspardlcv/devops_lab:app
Loading