Skip to content

Commit 86fce5a

Browse files
committedJul 18, 2021
compose sample 1 added
1 parent 0799649 commit 86fce5a

File tree

5 files changed

+118
-0
lines changed

5 files changed

+118
-0
lines changed
 

‎compose-sample-1/compose-2.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: '2'
2+
3+
services:
4+
5+
wordpress:
6+
image: wordpress
7+
ports:
8+
- 8080:80
9+
environment:
10+
WORDPRESS_DB_HOST: mysql
11+
WORDPRESS_DB_NAME: wordpress
12+
WORDPRESS_DB_USER: example
13+
WORDPRESS_DB_PASSWORD: examplePW
14+
volumes:
15+
- ./wordpress-data:/var/www/html
16+
17+
mysql:
18+
# we sue mariadb here for arm support
19+
# mariadb is a fork of MySQL that's often faster and better multi-platform
20+
image: mariadb
21+
environment:
22+
MYSQL_ROOT_PASSWORD: examplerootPW
23+
MYSQL_DATABASE: wordpress
24+
MYSQL_USER: example
25+
MYSQL_PASSWORD: examplePW
26+
volumes:
27+
- mysql-data:/var/lib/mysql
28+
29+
volumes:
30+
mysql-data:

‎compose-sample-1/compose-3.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: '3'
2+
# NOTE: This example only works on x86_64 (amd64)
3+
# Percona doesn't yet publish arm64 (Apple Silicon M1) or arm/v7 (Raspberry Pi 32-bit) images
4+
5+
services:
6+
ghost:
7+
image: ghost
8+
ports:
9+
- "80:2368"
10+
environment:
11+
- URL=http://localhost
12+
- NODE_ENV=production
13+
- MYSQL_HOST=mysql-primary
14+
- MYSQL_PASSWORD=mypass
15+
- MYSQL_DATABASE=ghost
16+
volumes:
17+
- ./config.js:/var/lib/ghost/config.js
18+
depends_on:
19+
- mysql-primary
20+
- mysql-secondary
21+
proxysql:
22+
# image only works on x86_64 (amd64)
23+
image: percona/proxysql
24+
environment:
25+
- CLUSTER_NAME=mycluster
26+
- CLUSTER_JOIN=mysql-primary,mysql-secondary
27+
- MYSQL_ROOT_PASSWORD=mypass
28+
29+
- MYSQL_PROXY_USER=proxyuser
30+
- MYSQL_PROXY_PASSWORD=s3cret
31+
mysql-primary:
32+
# image only works on x86_64 (amd64)
33+
image: percona/percona-xtradb-cluster:5.7
34+
environment:
35+
- CLUSTER_NAME=mycluster
36+
- MYSQL_ROOT_PASSWORD=mypass
37+
- MYSQL_DATABASE=ghost
38+
- MYSQL_PROXY_USER=proxyuser
39+
- MYSQL_PROXY_PASSWORD=s3cret
40+
mysql-secondary:
41+
# image only works on x86_64 (amd64)
42+
image: percona/percona-xtradb-cluster:5.7
43+
environment:
44+
- CLUSTER_NAME=mycluster
45+
- MYSQL_ROOT_PASSWORD=mypass
46+
47+
- CLUSTER_JOIN=mysql-primary
48+
- MYSQL_PROXY_USER=proxyuser
49+
- MYSQL_PROXY_PASSWORD=s3cret
50+
depends_on:
51+
- mysql-primary

‎compose-sample-1/docker-compose.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '2'
2+
3+
# same as
4+
# docker run -p 80:4000 -v $(pwd):/site bretfisher/jekyll-serve
5+
6+
services:
7+
jekyll:
8+
image: bretfisher/jekyll-serve
9+
volumes:
10+
- .:/site
11+
ports:
12+
- '80:4000'
13+
14+

‎compose-sample-1/template.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: '3.1' # if no version is specified then v1 is assumed. Recommend v2 minimum
2+
3+
services: # containers. same as docker run
4+
servicename: # a friendly name. this is also DNS name inside network
5+
image: # Optional if you use build:
6+
command: # Optional, replace the default CMD specified by the image
7+
environment: # Optional, same as -e in docker run
8+
volumes: # Optional, same as -v in docker run
9+
servicename2:
10+
11+
volumes: # Optional, same as docker volume create
12+
13+
networks: # Optional, same as docker network create
14+
15+
16+

‎docker-process-approach/docker-4.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Making It Easier with Docker Compose: The Multi-Container Tool
22

3+
* Why : Configure relationships between containers &
4+
Save our docker container to run the settings in easy to read file & create one liner developer environment startups.
5+
* Comprised of 2 seperated but related things.
6+
* YAML formatted file that describes our solutions for:
7+
Containers, Networks and Volumes.
8+
* A CLI tool docker-compose used for local dev/test automation with those YAML files.
9+
310
## Docker Compose and The Docker-compose.yml File
411
```
512
docker-compose.yml

0 commit comments

Comments
 (0)
Please sign in to comment.