-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
stack-ee-ghost.yml
73 lines (60 loc) · 1.57 KB
/
stack-ee-ghost.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
version: '3.7'
x-default-opts:
&default-opts
logging:
options:
max-size: "1m"
# driver: "gelf"
# options:
# gelf-address: "udp://127.0.0.1:5000"
services:
ghost:
<<: *default-opts
image: ghost:1-alpine
environment:
# see https://docs.ghost.org/docs/config#section-running-ghost-with-config-env-variables
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: YOURDBPASSWORDhere
database__connection__database: ghost
url: http://ghost.dogvscat.biz
deploy:
replicas: 1
labels:
com.docker.lb.port: 2368
com.docker.lb.hosts: ghost.dogvscat.biz
db:
<<: *default-opts
image: mysql:5.7
volumes:
- db:/var/lib/mysql
secrets:
- ghost-db-password
deploy:
endpoint_mode: dnsrr
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/ghost-db-password
db-backup:
<<: *default-opts
image: mysql:5.7
command: sh -c "while true; do /usr/bin/mysqldump -u root --password=$$(< $$MYSQL_ROOT_PASSWORD_FILE) --all-databases --host=db > /backup/backup$$(date +'%H').sql ; sleep 3600; done"
volumes:
- db-backup:/backup
secrets:
- ghost-db-password
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/ghost-db-password
#TODO: backup for static content
volumes:
db:
driver: cloudstor:latest
driver_opts:
size: 1
db-backup:
driver: cloudstor:latest
driver_opts:
size: 1
secrets:
ghost-db-password:
external: true