forked from Sonal0409/DevOps_ClassNotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker_compose_files.txt
More file actions
125 lines (101 loc) · 2.02 KB
/
docker_compose_files.txt
File metadata and controls
125 lines (101 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
UseCase 1
==============
Create a docker compose file for setting up a wordpress container and link
with a mysql container
---
version: '3'
services:
mydb:
image: mysql:5
environment:
MYSQL_ROOT_PASSWORD: psswd
mywordpress:
image: wordpress
ports:
- 9999:80
links:
- mydb:mysql
...
To start the containers
docker-compose up
To start the containers indetached node
docker-compose up -d
To stop the containers
docker-compose stop
To stop and delete the containers
docker-compose down
To see the list of processes in the container
docker-compose ps
To start the stopped container
docker-compose start
To pause the executiong
docker-compose pause
To unpause
docker-compose unpause
******************************************
Create a docker compose file for seeting up the CI-CD environment
where a jenkins contianer is linked with 2 tomcat contianer
vim docker-compose.yml
---
version: '3'
services:
jenkinsserver:
image: jenkins
ports:
- 5050:8080
qaserver:
image: tomcat
ports:
- 6060:8080
links:
- jenkinsserver:jenkins
prodserver:
image: tomcat
ports:
- 7070:8080
links:
- jenkinsserver:jenkins
...
=================================================================================
Docker compose file to setup the LAMP environment
vim docker-compose.yml
version: '3'
services:
mydb:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: passwd
apache:
image: httpd
ports:
- 9090:80
links:
- mydb:mysql
php:
image: php:7.2-apache
links:
- mydb:mysql
- apache:httpd
=================================================================================
Docker compose file to setup the selenium testing environment where
a hub container can be linked with a chrome and firefox node containers
---
version: '3'
services:
hub:
image: selenium/hub
ports:
- 4444:4444
chrome:
image: selenium/node-chrome-debug
ports:
- 5901:5900
links:
- hub:selenium
firefox:
image: selenium/node-firefox-debug
ports:
- 5902:5900
links:
- hub:selenium
...