-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
189 lines (173 loc) · 5.42 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
version: '3.4'
# # RANCHER : use this instead
# version: '2'
# TODO : replace olivierdalang repository by pacificcommunity
# Common Django template for Geonode, Celery and Celerycam services below
# RANCHER : manually copy this to each service below
x-common-django:
&default-common-django
image: olivierdalang/spcgeonode:django-latest
# RANCHER : remove this
build: .
environment:
- HTTPS_HOST=${HTTPS_HOST}
- HTTPS_PORT=${HTTPS_PORT}
- HTTP_HOST=${HTTP_HOST}
- HTTP_PORT=${HTTP_PORT}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- DEBUG=False
- REGISTRATION_OPEN=${REGISTRATION_OPEN}
- TIME_ZONE=${TIME_ZONE}
volumes:
- static:/spcgeonode-static/
- media:/spcgeonode-media/
secrets:
- admin_username
- admin_password
labels:
io.rancher.container.pull_image: always
restart: on-failure
services:
# Our custom django application. It includes Geonode.
django:
<< : *default-common-django
healthcheck:
test: "curl --fail --silent --write-out 'HTTP CODE : %{http_code}\n' --output /dev/null http://127.0.0.1:8001/"
interval: 60s
timeout: 10s
retries: 1
start_period: 60s
entrypoint: ["/spcgeonode/docker-entrypoint.sh"]
command: "uwsgi --chdir=/spcgeonode --module=spcgeonode.wsgi --socket=:8000 --http=127.0.0.1:8001 --processes=5"
# Celery worker that executes celery tasks created by Django.
celery:
<< : *default-common-django
entrypoint: []
command: 'celery worker --app=geonode.celery_app:app -l info'
# Celery beat that triggers scheduled tasks
celerybeat:
<< : *default-common-django
entrypoint: []
command: 'celery beat --app=geonode.celery_app:app --pidfile="/celerybeat.pid" -l info'
# Celery camera that monitors celery tasks and populate the djcelery django admin interface
celerycam:
<< : *default-common-django
entrypoint: []
command: 'celery events --app=geonode.celery_app:app --pidfile="/celeryev.pid" --camera=django_celery_monitor.camera.Camera --frequency=2.0 -l info'
# Nginx is serving django static and media files and proxies to django and geonode
nginx:
image: olivierdalang/spcgeonode:nginx-latest
# RANCHER : remove this
build: _service_nginx/
environment:
- HTTPS_HOST=${HTTPS_HOST}
- HTTP_HOST=${HTTP_HOST}
- LETSENCRYPT_MODE=${LETSENCRYPT_MODE}
- RESOLVER=127.0.0.11
# # RANCHER : use this instead
# - RESOLVER=169.254.169.250
ports:
- "${HTTP_PORT}:80"
- "${HTTPS_PORT}:443"
volumes:
- static:/spcgeonode-static/
- media:/spcgeonode-media/
- certificates:/spcgeonode-certificates/
restart: on-failure
labels:
io.rancher.container.pull_image: always
# Geoserver backend
geoserver:
image: olivierdalang/spcgeonode:geoserver-latest
# RANCHER : remove this
build: _service_geoserver/
healthcheck:
test: "curl --fail --silent --write-out 'HTTP CODE : %{http_code}\n' --output /dev/null http://127.0.0.1:8080/geoserver/rest/workspaces/geonode.html"
interval: 60s
timeout: 10s
retries: 1
start_period: 60s
environment:
- HTTPS_HOST=${HTTPS_HOST}
- HTTPS_PORT=${HTTPS_PORT}
- HTTP_HOST=${HTTP_HOST}
- HTTP_PORT=${HTTP_PORT}
volumes:
- geodatadir:/spcgeonode-geodatadir/
secrets:
- admin_username
- admin_password
restart: on-failure
labels:
io.rancher.container.pull_image: always
# Gets and installs letsencrypt certificates
letsencrypt:
image: olivierdalang/spcgeonode:letsencrypt-latest
# RANCHER : remove this
build: _service_letsencrypt/
environment:
- HTTPS_HOST=${HTTPS_HOST}
- HTTP_HOST=${HTTP_HOST}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- LETSENCRYPT_MODE=${LETSENCRYPT_MODE}
volumes:
- certificates:/spcgeonode-certificates/
restart: on-failure
labels:
io.rancher.container.pull_image: always
pgdumper:
image: olivierdalang/spcgeonode:pgdumper-latest
# RANCHER : remove this
build: _service_pgdumper/
volumes:
- pgdumps:/spcgeonode-pgdumps/
restart: on-failure
labels:
io.rancher.container.pull_image: always
rclone:
image: olivierdalang/spcgeonode:rclone-latest
# RANCHER : remove this
build: _service_rclone/
secrets:
- rclone_backup_conf
volumes:
- pgdumps:/spcgeonode-pgdumps/
- media:/spcgeonode-media/
- geodatadir:/spcgeonode-geodatadir/
restart: on-failure
labels:
io.rancher.container.pull_image: always
# PostGIS database.
postgres:
image: mdillon/postgis:9.6-alpine
volumes:
- database:/var/lib/postgresql/data/
restart: on-failure
# Vanilla RabbitMQ service. This is needed by celery
rabbitmq:
image: rabbitmq:3.7-alpine
restart: on-failure
volumes:
static:
media:
database:
geodatadir:
certificates:
pgdumps:
secrets:
admin_username:
file: _secrets/admin_username
external: false
admin_password:
file: _secrets/admin_password
external: false
rclone_backup_conf:
file: _secrets/rclone.backup.conf
external: false
# # RANCHER : use this instead
# admin_username:
# external: true
# admin_password:
# external: true
# rclone_backup_conf:
# external: true