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