-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdocker-compose.yml
197 lines (185 loc) · 5.48 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#
# Production server with UWSGI configured to run on port 8080
# Please use the accompanying make targets to run rather than
# calling docker-compose commands directly on this file.
version: '2'
services:
smtp:
image: catatnight/postfix
hostname: postfix
environment:
# You could change this to something more suitable
- maildomain=kartoza.com
- smtp_user=noreply:docker
network_mode: "bridge"
db: &db
image: kartoza/postgis:9.6-2.4
restart: on-failure
volumes:
- ./pg/postgres_data:/var/lib/postgresql
environment:
- POSTGRES_USER=docker
- POSTGRES_PASS=docker
- POSTGRES_DB=gis
- USERNAME=docker
- PASS=docker
network_mode: "bridge"
rabbitmq:
image: library/rabbitmq:3.6
restart: on-failure
hostname: rabbitmq
environment:
- RABBIT_PASSWORD=rabbit_test_password
- USER=rabbit_user
- RABBITMQ_NODENAME=rabbit
links:
- db:db
network_mode: "bridge"
dbbackup: &dbbackup
build: docker-backup
hostname: pg-backups
volumes:
- ./pg/dbbackup/backups:/backups
# this folder is used as target folder for sftppgbackup as the
# source folder
- ./sftp_backup/target/pg:/pg_backup
links:
- db:db
environment:
# make this equal to PG_$(PROJECT_ID) in makefile
- DUMPPREFIX=PG_inasafedjango
# These are all defaults anyway, but setting explicitly in
# case we ever want to ever use different credentials
- PGUSER=docker
- PGPASSWORD=docker
- PGPORT=5432
- PGHOST=db
- PGDATABASE=gis
network_mode: "bridge"
sftppgbackup: &sftppgbackup
image: kartoza/sftp-backup:1.0
hostname: sftppgbackup
volumes:
# this folder is used to store local backups from pg dbbackup
- ./sftp_backup/backups/pg:/backups
# this folder is used as target folder/source where the backup comes from
# this backup comes from dbbackup
- ./sftp_backup/target/pg:/pg_backup
environment:
- DUMPPREFIX=PG_inasafedjango
- DAILY=14
- MONTHLY=12
- YEARLY=3
# set this to the target/source folder where the backup comes from
- TARGET_FOLDER=/pg_backup
env_file:
- sftp_pg_credential.env
network_mode: "bridge"
sftpmediabackup: &sftpmediabackup
image: kartoza/sftp-backup:1.0
hostname: sftpmediabackup
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
- ./media:/media_backup
environment:
- DUMPPREFIX=MEDIA_inasafedjango
# reduce frequency because the dump is really big
- DAILY=3
- MONTHLY=2
- YEARLY=1
- TARGET_FOLDER=/media_backup
env_file:
- sftp_media_credential.env
network_mode: "bridge"
uwsgi: &uwsgi
build: docker-prod
environment:
- DATABASE_NAME=gis
- DATABASE_USERNAME=docker
- DATABASE_PASSWORD=docker
- DATABASE_HOST=db
- DJANGO_SETTINGS_MODULE=core.settings.prod_docker
- VIRTUAL_HOST=users.inasafe.org
- VIRTUAL_PORT=8080
- BROKER_URL=amqp://guest:guest@rabbitmq:5672/
volumes:
- ../django_project:/home/web/django_project
- ./static:/home/web/static
- ./media:/home/web/media
- ./reports:/home/web/reports
- ./logs:/var/log/
links:
- smtp:smtp
- db:db
- dbbackup:dbbackup
- sftppgbackup:sftppgbackup
- sftpmediabackup:sftpmediabackup
- rabbitmq:rabbitmq
- qgis-templates-btsync:qgis-templates-btsync
env_file:
- inaware_credential.env
network_mode: "bridge"
inasafe-worker: &inasafe-worker
<<: *uwsgi
restart: on-failure
working_dir: /home/web/django_project
command: celery -A core.celery_app worker --loglevel=info -Q inasafe-django -n inasafe-django.%h
environment:
- DATABASE_NAME=gis
- DATABASE_USERNAME=docker
- DATABASE_PASSWORD=docker
- DATABASE_HOST=db
- DJANGO_SETTINGS_MODULE=core.settings.prod_docker
- C_FORCE_ROOT=True
- BROKER_URL=amqp://guest:guest@rabbitmq:5672/
- PYTHONPATH=/home/web/django_project
links:
- smtp:smtp
- db:db
- rabbitmq:rabbitmq
network_mode: "bridge"
integration-test-worker:
<<: *inasafe-worker
indicator-worker:
<<: *inasafe-worker
restart: on-failure
command: celery -A core.celery_app worker --loglevel=info -Q inasafe-django-indicator -B -n indicator.%h
network_mode: "bridge"
web: &web
image: nginx
hostname: nginx
volumes:
- ./sites-enabled:/etc/nginx/conf.d:ro
# I dont use volumes_from as I want to use the ro modifier
- ./static:/home/web/static:ro
- ./media:/home/web/media:ro
- ./logs:/var/log/nginx
links:
- uwsgi:uwsgi
ports:
- "61100:8080"
network_mode: "bridge"
contexts-btsync:
image: kartoza/btsync
volumes:
- ./headless-data/contexts:/web
environment:
- DEVICE=InaSAFE-Headless-Contexts
network_mode: "bridge"
qgis-templates-btsync:
image: alpine/git
working_dir: /web
entrypoint:
- /bin/sh
command:
- -c
- git pull origin master && git log HEAD^..HEAD && tail -f /dev/null
volumes:
- ./headless-data/qgis-templates:/web
environment:
- DEVICE=InaSAFE-Headless-QGIS-Templates
- STANDBY_MODE=TRUE
network_mode: "bridge"