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
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node

WORKDIR /Users/Rim/Desktop/devops-lab

COPY index.js /Users/Rim/Desktop/devops-lab

RUN npm install express
RUN npm install mysql

ENV MYSQL_HOST=host.docker.internal
ENV MYSQL_USER=root
ENV MYSQL_PASSWORD=
ENV MYSQL_DATABASE=nodejs
ENV MYSQL_PORT=3306

EXPOSE 3000

CMD node index.js
46 changes: 26 additions & 20 deletions answers.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
# Answers

Lastname:
Firstname:
Lastname: Zaafouri
Firstname: Rim

## 2.2
command:
command: docker run app

## 2.3
question:
command:
question: The call fails because the service cannot access the port.
command: docker run -p 3000:3000 index.js

## 2.5
question:
command:
question: We identify the repository using the tag to push the image
command: docker tag index.js rz160211/devops-lab
docker push rz160211/devops-lab

## 2.6
command:
command: docker system prune -a

question:
command:
question: We start a container
command: docker pull rz160211/devops-lab

command:
command: docker create rz160211/devops-lab docker run rz160211/devops-lab

## 2.7
question:
question:
command:
question: We retrieve the list of all containers and check that our container is started
question: the name of my container is first_container
command: docker ps

command:
command: docker rename first_container app

## 2.8
question:
output:
question: The name of the container is Alpine Linux
output: NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.8.1
PRETTY_NAME="Alpine Linux v3.8"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"

## 3.1
command:
command: docker-compose up

## 3.4
command:
command:
command: docker-compose up -d
command: docker-compose logs
Loading