Skip to content

Commit ab3704f

Browse files
Add files via upload
1 parent 3dc6079 commit ab3704f

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

DockerCommands/1.1_Task1.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---Task:-1
2+
3+
Create two containers on bridge network which uses front-end application as a docker image "whizlabs/webapp" and another container which refers to "whizlabs/mysql" docker image. Modify the code of webapp such that it uses the mysql connectionstring/database/tables from other running container.
4+
5+
---Solution
6+
7+
docker run --name webapp -it -p 80:80 -d whizlabs/webapp
8+
docker run --name db -it -d whizlabs/mysql

DockerCommands/1.2_Task2.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---Task:-2
2+
3+
Create a docker a service webapp which refers to whizlabs/webapp ( it is a custom php application) for the front-end and another service db( it is a mysql image) on which webapp depends called db using docker compose file.
4+
5+
---Solution
6+
create docker-compose.yml file with following code
7+
8+
version: '3.3'
9+
10+
services:
11+
db:
12+
image: whizlabs/mysql
13+
14+
webapp:
15+
depends_on:
16+
- db
17+
image: whizlabs/webapp
18+
ports:
19+
- "80:80"
20+
21+
Now run the docker compose with following command
22+
23+
docker-compose up -d

DockerCommands/1.3_Task3.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Task:-3
2+
3+
Create docker swarm services using docker stack to implement webapp (whizlabs/webapp )and db app (whizlabs/mysql) on docker swarm cluster.
4+
5+
Solution:--
6+
cp docker-compose.yml mystack.yml
7+
docker stack deploy -c mystack.yml mystack

0 commit comments

Comments
 (0)