forked from GeoNode/geonode-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geonode-stack.yml
165 lines (153 loc) · 4.01 KB
/
geonode-stack.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
version: '3.9'
# Common Django template for GeoNode and Celery services below
x-common-django:
&default-common-django
image: django:latest
env_file:
- .env
volumes:
# - '.:/usr/src/geonode_demo'
- statics:/mnt/volumes/statics
- geoserver-data-dir:/geoserver_data/data
- backup-restore:/backup_restore
- data:/data
- tmp:/tmp
# Common template for service restart policy
x-common-swarm-deploy:
&default-common-swarm-deploy
replicas: 1
restart_policy:
condition: any
delay: 0s
max_attempts: 10
window: 60s
services:
# Our custom django application. It includes Geonode.
django:
<< : *default-common-django
deploy: *default-common-swarm-deploy
build:
context: ./
dockerfile: Dockerfile
healthcheck:
test: "curl --fail --silent --write-out 'HTTP CODE : %{http_code}\n' --output /dev/null http://127.0.0.1:8000/"
interval: 60s
timeout: 10s
retries: 1
start_period: 60s
environment:
IS_CELERY: 'False'
entrypoint: ["/usr/src/geonode_demo/entrypoint.sh"]
command: "uwsgi --ini /usr/src/geonode_demo/uwsgi.ini"
# Celery worker that executes celery tasks created by Django.
celery:
<< : *default-common-django
deploy: *default-common-swarm-deploy
depends_on:
- django
environment:
- IS_CELERY=True
entrypoint: ["/usr/src/geonode_demo/entrypoint.sh"]
command: "celery-cmd"
# Nginx is serving django static and media files and proxies to django and geonode
geonode:
deploy: *default-common-swarm-deploy
image: geonode/nginx:3.x
build: ./docker/nginx/
environment:
- HTTPS_HOST=localhost
- HTTP_HOST=localhost
- HTTPS_PORT=443
- HTTP_PORT=80
- LETSENCRYPT_MODE=disabled
- RESOLVER=127.0.0.11
env_file:
- .env
ports:
- "${HTTP_PORT}:80"
- "${HTTPS_PORT}:443"
volumes:
- nginx-confd:/etc/nginx
- nginx-certificates:/geonode-certificates
- statics:/mnt/volumes/statics
# Gets and installs letsencrypt certificates
letsencrypt:
deploy: *default-common-swarm-deploy
image: geonode/letsencrypt:latest
build: ./docker/letsencrypt/
environment:
- HTTPS_HOST=localhost
- HTTP_HOST=localhost
- ADMIN_EMAIL=admin@localhost
- LETSENCRYPT_MODE=disabled
env_file:
- .env
volumes:
- nginx-certificates:/geonode-certificates
# Geoserver backend
geoserver:
deploy: *default-common-swarm-deploy
image: geonode/geoserver:2.20.6
build: ./docker/geoserver/
env_file:
- .env
healthcheck:
test: curl --fail -s http://localhost:8080/geoserver/rest/workspaces/geonode.html || exit 1
interval: 60s
timeout: 10s
retries: 1
start_period: 60s
volumes:
- statics:/mnt/volumes/statics
- geoserver-data-dir:/geoserver_data/data
- backup-restore:/backup_restore
- data:/data
- tmp:/tmp
data-dir-conf:
image: geonode/geoserver_data:2.20.6
command: /bin/true
volumes:
- geoserver-data-dir:/geoserver_data/data
# PostGIS database.
db:
deploy: *default-common-swarm-deploy
# use geonode official postgis 13 image
image: geonode/postgis:13
command: postgres -c "max_connections=${POSTGRESQL_MAX_CONNECTIONS}"
volumes:
- dbdata:/var/lib/postgresql/data
- dbbackups:/pg_backups
env_file:
- .env
# uncomment to enable remote connections to postgres
#ports:
# - "5432:5432"
# Vanilla RabbitMQ service. This is needed by celery
rabbitmq:
deploy: *default-common-swarm-deploy
image: rabbitmq:3.7-alpine
volumes:
- rabbitmq:/var/lib/rabbitmq
env_file:
- .env
volumes:
statics:
name: statics
nginx-confd:
name: nginxconfd
nginx-certificates:
name: nginxcerts
geoserver-data-dir:
name: gsdatadir
dbdata:
name: dbdata
dbbackups:
name: dbbackups
backup-restore:
name: backup-restore
data:
name: data
tmp:
name: tmp
rabbitmq:
name: rabbitmq