forked from WuCris/Ghost-Docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
63 lines (57 loc) · 1.69 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
version: "3"
services:
ghost:
image: "ghost:5.74"
environment:
# see https://ghost.org/docs/config/#configuration-options
database__client: mysql
database__connection__host: ghost-db-master
database__connection__user: ghost
database__connection__password: ghostpassword
database__connection__database: ghost
# this url value is just an example, and is likely wrong for your environment!
url: http://localhost:8080
# contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
NODE_ENV: production
depends_on:
- ghost-db-master
ghost-proxy:
image: ghostcms-web
build: nginx
environment:
NODE_ENV: production
ports:
- "8080:80"
ghost-db-master:
image: "ghost-mysql:8.2"
build: mysql
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: ghost
MYSQL_USER: ghost
MYSQL_PASSWORD: ghostpassword
# The master node cannot be replicated.
MYSQL_ROLE: master
volumes:
- ghost-db-master:/var/lib/mysql
- ghost-temp-db:/tmp/mysql-backup
ghost-db-slave:
# We use the same custom image
image: "ghost-mysql:8.2"
build: mysql
environment:
MYSQL_ROOT_PASSWORD: rootpassword
# MYSQL_DATABASE: ghost
# MYSQL_USER: ghost
# MYSQL_PASSWORD: ghostpassword
# Role must be assiged to slave
MYSQL_ROLE: slave
volumes:
- ghost-db-slave:/var/lib/mysql
- ghost-temp-db:/tmp/mysql-backup
depends_on:
- ghost-db-master
volumes:
ghost-db-master:
ghost-db-slave:
ghost-temp-db: