-
Notifications
You must be signed in to change notification settings - Fork 1
/
compose.yml
180 lines (170 loc) · 5.44 KB
/
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
include:
- ./compose-volumes_${VOLUMES:-default}.yml
# Common Django template for GeoNode and Celery services below
x-common-django:
&default-common-django
image: ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}${COMPOSE_PROJECT_NAME}_django:${GEONODE_BASE_IMAGE_VERSION}-${PROJECT_VERSION}
build:
context: ./docker/geonode
dockerfile: Dockerfile
args:
- BASE_IMAGE_VERSION=${GEONODE_BASE_IMAGE_VERSION}
restart: always
env_file:
- .env
volumes:
# configuration
- ./geonode/geonode/settings_override.py:/usr/src/geonode/geonode/settings_override.py
- ./geonode/geonode/catalogue/templates/catalogue/full_metadata.xml:/usr/src/geonode/geonode/catalogue/templates/catalogue/full_metadata.xml
- ./geonode/geonode/templates/subsites:/usr/src/geonode/geonode/templates/subsites
- ./geonode/geonode/templates/subsites/statics/:/usr/src/geonode/geonode/static/subsites
- ./geonode/fixtures:/usr/src/geonode/fixtures
# contrib apps
- ./geonode/apps/atlas:/usr/src/geonode/atlas
- ./geonode/apps/thuenen_app:/usr/src/geonode/thuenen_app
- ./geonode/apps/externalapplications/externalapplications:/usr/src/geonode/externalapplications
# volumes
- statics:/mnt/volumes/statics
- geoserver-data-dir:/geoserver_data/data
- backup-restore:/backup_restore
- data:/data
- tmp:/tmp
depends_on:
db:
condition: service_healthy
data-dir-conf:
condition: service_healthy
networks:
- thuenen_network
services:
# Our custom django application. It includes Geonode.
django:
<< : *default-common-django
container_name: django4${COMPOSE_PROJECT_NAME}
healthcheck:
test: "curl --fail --silent --write-out 'HTTP CODE : %{http_code}\n' --output /dev/null http://127.0.0.1:8000/"
start_period: 60s
interval: 60s
timeout: 10s
retries: 10
environment:
- DJANGO_SETTINGS_MODULE=geonode.settings_override
- IS_CELERY=False
entrypoint: ["/usr/src/geonode/entrypoint.sh"]
command: "uwsgi --ini /usr/src/geonode/uwsgi.ini"
# Celery worker that executes celery tasks created by Django.
celery:
<< : *default-common-django
container_name: celery4${COMPOSE_PROJECT_NAME}
depends_on:
- django
environment:
- DJANGO_SETTINGS_MODULE=geonode.settings_override
- IS_CELERY=True
entrypoint: ["/usr/src/geonode/entrypoint.sh"]
command: "celery-cmd"
# Nginx is serving django static and media files and proxies to django and geonode
geonode:
build:
context: ./docker/nginx
dockerfile: Dockerfile
args:
- BASE_IMAGE_VERSION=${NGINX_BASE_IMAGE_VERSION}
container_name: nginx4${COMPOSE_PROJECT_NAME}
env_file: ./.env
environment:
- HTTPS_HOST=${SITE_HOST_NAME}
# emtpy HTTP_x to only allow HTTPS connections
#- HTTP_HOST=${GEONODE_LB_HOST_IP}
- LETSENCRYPT_MODE=disabled
- RESOLVER=127.0.0.11
ports:
- "80:80"
- "443:443"
volumes:
- statics:/mnt/volumes/statics
# Link to a custom certificate here
#- <path-to-cert>.pem:/geonode-certificates/autoissued/fullchain.pem
#- <path-to-key>.pem:/geonode-certificates/autoissued/privkey.pem
restart: on-failure
networks:
thuenen_network:
ipv4_address: 172.18.0.100
# Geoserver backend
geoserver:
build:
context: ./docker/geoserver
dockerfile: Dockerfile
args:
- BASE_IMAGE_VERSION=${GEOSERVER_BASE_IMAGE_VERSION}
container_name: geoserver4${COMPOSE_PROJECT_NAME}
env_file: ./.env
healthcheck:
test: "curl --fail --silent --write-out 'HTTP CODE : %{http_code}\n' --output /dev/null http://127.0.0.1:8080/geoserver/ows"
start_period: 60s
interval: 60s
timeout: 10s
retries: 10
volumes:
- statics:/mnt/volumes/statics
- geoserver-data-dir:/geoserver_data/data
- backup-restore:/backup_restore
- data:/data
- tmp:/tmp
restart: unless-stopped
depends_on:
db:
condition: service_healthy
data-dir-conf:
condition: service_healthy
networks:
- thuenen_network
data-dir-conf:
build:
context: ./docker/geoserver_data
dockerfile: Dockerfile
args:
- BASE_IMAGE_VERSION=${GEOSERVER_DATA_BASE_IMAGE_VERSION}
container_name: gsconf4${COMPOSE_PROJECT_NAME}
entrypoint: sleep infinity
volumes:
- geoserver-data-dir:/geoserver_data/data
restart: unless-stopped
healthcheck:
test: "ls -A '/geoserver_data/data' | wc -l"
networks:
- thuenen_network
# PostGIS database.
db:
build:
context: ./docker/postgresql
dockerfile: Dockerfile
args:
- BASE_IMAGE_VERSION=${POSTGRES_BASE_IMAGE_VERSION}
command: postgres -c "max_connections=${POSTGRES_MAX_CONNECTIONS}"
container_name: db4${COMPOSE_PROJECT_NAME}
env_file: ./.env
volumes:
- dbdata:/var/lib/postgresql/data
- dbbackups:/pg_backups
restart: unless-stopped
healthcheck:
test: "pg_isready -d postgres -U postgres"
networks:
- thuenen_network
# Vanilla RabbitMQ service. This is needed by celery
rabbitmq:
image: rabbitmq:3-alpine
container_name: rabbitmq4${COMPOSE_PROJECT_NAME}
volumes:
- rabbitmq:/var/lib/rabbitmq
restart: unless-stopped
networks:
- thuenen_network
networks:
thuenen_network:
name: thuenen_network
ipam:
config:
- subnet: "172.18.0.0/16"
gateway: "172.18.0.1"