-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
109 lines (98 loc) · 2.13 KB
/
docker-compose.yml
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
version: '2'
services:
####
##Web Applications
#####
wordpress:
container_name: wordpress
restart: always
image: wordpress:fpm # https://hub.docker.com/_/wordpress/
volumes:
- wordpress-data:/var/www/html
environment:
WORDPRESS_DB_HOST: mysql
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: password
networks:
- front
- back-wordpress
ghost:
container_name: ghost
restart: always
image: ghost
environment:
MARIADB_HOST: mariadb
GHOST_DATABASE_USER: user
GHOST_DATABASE_NAME: ghost
MARIADB_PASSWORD: password
GHOST_HOST: localhost
volumes:
- ghost-data:/var/lib/ghost/content
depends_on:
- mariadb
networks:
- front
- back-ghost
#####
# Database
#####
mysql:
container_name: mysql
image: mysql:latest # https://hub.docker.com/_/mysql/ - or mariadb https://hub.docker.com/_/mariadb
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DATABASE: wordpress
volumes:
- wordpress-db-data:/var/lib/mysql
networks:
- back-wordpress
mariadb:
container_name: mariadb
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DATABASE: ghost
volumes:
- ghost-db-data:/var/lib/mysql
networks:
- back-ghost
####
# NGINX
####
nginx:
container_name: nginx
restart: always
image: nginx:alpine
links:
- wordpress
- ghost:ghost
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/config:/etc/nginx/conf.d
- ./nginx/global:/etc/nginx/global
- ./nginx/ssl:/etc/ssl
- wordpress-data:/var/www/html/:ro
ports:
- 80:80
- 443:443
command: /bin/sh -c "nginx -g 'daemon off;'"
networks:
- front
volumes:
wordpress-data:
driver: local
ghost-data:
driver: local
wordpress-db-data:
driver: local
ghost-db-data:
driver: local
networks:
front:
back-wordpress:
back-ghost: