-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
103 lines (98 loc) · 2.97 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
## Base compose configuration
wordpress:
image: tutum/wordpress-stackable
hostname: inasafe.org
restart: unless-stopped
links:
- db
- sftpmediabackup:sftpmediabackup
- sftpdbbackup:sftpdbbackup
ports:
- "8101:80"
environment:
DB_NAME: wordpress
DB_USER: admin
# Environment variables with only a key are resolved to their
# values on the machine Compose is running on.
# so make sure to set the DB_PASS env var before using this config file
# DB_PASS:
DB_HOST: db
DB_PORT: 3306
env_file:
# Wordpress credentials, set the DB_PASS environment
- wordpress_credential.env
volumes_from:
# so we can have /backups folder for making backups
- db
volumes:
# This so we can share the app dir as a container storage volume
- /app
# so we can persist media
- ./wp-content:/app/wp-content
sftpdbbackup: &sftpdbbackup
image: kartoza/sftp-backup:1.0
hostname: sftpdbbackup
restart: unless-stopped
volumes:
# this folder is used to store local backups from pg dbbackup
- ./sftp_backup/backups/db:/backups
# this folder is used as target folder/source where the backup comes from
# this backup comes from dbbackup
- ./sftp_backup/target/db:/db_backup
environment:
- DUMPPREFIX=DB_inasafe.org
- DAILY=14
- MONTHLY=12
- YEARLY=3
# set this to the target/source folder where the backup comes from
- TARGET_FOLDER=/db_backup
# You can specify this in sftp_db_credential.env
# - SFTP_DIR=/inasafe/inasafe.org/db/
env_file:
- sftp_db_credential.env
sftpmediabackup: &sftpmediabackup
image: kartoza/sftp-backup:1.0
hostname: sftpmediabackup
restart: unless-stopped
volumes:
# this folder is used to store local backups from django media
- ./sftp_backup/backups/media:/backups
# this folder is used as target folder/source where the backup comes from
# this backup comes from django media
- ./wp-content:/media_backup
environment:
- DUMPPREFIX=MEDIA_inasafe.org
# reduce frequency because the dump is really big
- DAILY=3
- MONTHLY=2
- YEARLY=1
- TARGET_FOLDER=/media_backup
# You can specify this in sftp_media_credential.env
# - SFTP_DIR=/inasafe/inasafe.org/media/
env_file:
- sftp_media_credential.env
db:
hostname: db.inasafe.org
build: docker-db
restart: unless-stopped
links:
- sftpdbbackup:sftpdbbackup
env_file:
# Make sure to set the MYSQL_PASS env var before using this config file
# set MYSQL_PASS environment
- mysql_credential.env
volumes:
- ./backups:/backups
- ./sftp_backup/target/db:/target
# This will not work on OSX/Win - comment out for those oses
# See https://github.com/tutumcloud/tutum-docker-mariadb/issues/5
# The linux configuration will override this for production mode
# - ./db:/var/lib/mysql
btsync:
image: kartoza/btsync
hostname: inasafe.org-btsync
restart: unless-stopped
volumes:
- ./sftp_backup:/web
env_file:
- ./btsync.env