-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
204 lines (193 loc) · 5.58 KB
/
Copy pathdocker-compose.yml
File metadata and controls
204 lines (193 loc) · 5.58 KB
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
198
199
200
201
202
203
204
x-common-django:
&default-common-django
image: geonode/geonode:latest-ubuntu-24.04
build:
context: ./
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- .env${ENVIRONMENT:+_${ENVIRONMENT}}
volumes:
# - './src:/usr/src/geonode' # Uncomment for local development
- statics:/mnt/volumes/statics
- geoserver-data-dir:/geoserver_data/data
- backup-restore:/backup_restore
- data:/data
- tmp:/tmp
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
memcached:
condition: service_healthy
services:
# Our custom django application. It includes Geonode.
django:
<< : *default-common-django
build:
context: ./
dockerfile: Dockerfile
container_name: django4${COMPOSE_PROJECT_NAME}
healthcheck:
test: "curl -m 10 --fail --silent --output /dev/null http://django:8000/"
start_period: 60s
interval: 60s
timeout: 10s
retries: 2
environment:
- 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}
environment:
- IS_CELERY=True
entrypoint: ["/usr/src/geonode/entrypoint.sh"]
command: "celery-cmd"
healthcheck:
test: "celery -b ${BROKER_URL} inspect ping"
start_period: 30s
interval: 30s
timeout: 10s
retries: 2
# Nginx is serving django static and media files and proxies to django and geonode
nginx:
image: geonode/nginx:1.31.0-latest
container_name: nginx4${COMPOSE_PROJECT_NAME}
env_file:
- .env${ENVIRONMENT:+_${ENVIRONMENT}}
environment:
- RESOLVER=127.0.0.11
ports:
- "${HTTP_PORT}:80"
- "${HTTPS_PORT}:443"
volumes:
- nginx-confd:/etc/nginx
- nginx-certificates:/geonode-certificates
- statics:/mnt/volumes/statics
restart: unless-stopped
healthcheck:
test: "if ps -o pid | grep -w 1 > /dev/null; then echo 'nginx running'; else exit 1;fi"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
# memcached service
memcached:
image: memcached:alpine
container_name: memcached4${COMPOSE_PROJECT_NAME}
command: memcached ${MEMCACHED_OPTIONS}
restart: unless-stopped
healthcheck:
test: ["CMD", "nc", "-z", "127.0.0.1", "11211"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# Gets and installs letsencrypt certificates
letsencrypt:
image: geonode/letsencrypt:2.6.0-latest
container_name: letsencrypt4${COMPOSE_PROJECT_NAME}
env_file:
- .env${ENVIRONMENT:+_${ENVIRONMENT}}
volumes:
- nginx-certificates:/geonode-certificates
restart: unless-stopped
depends_on:
nginx:
condition: service_healthy
# Geoserver backend
geoserver:
image: geonode/geoserver:2.28.x-latest
container_name: geoserver4${COMPOSE_PROJECT_NAME}
healthcheck:
test: ["CMD", "curl", "-f", "http://geoserver:8080/geoserver/web/wicket/resource/org.geoserver.web.GeoServerBasePage/img/logo.png"]
start_period: 30s
interval: 30s
timeout: 10s
retries: 3
env_file:
- .env${ENVIRONMENT:+_${ENVIRONMENT}}
ports:
- "8080:8080"
volumes:
- statics:/mnt/volumes/statics
- geoserver-data-dir:/geoserver_data/data
- backup-restore:/backup_restore
- data:/data
- tmp:/tmp
restart: unless-stopped
depends_on:
data-dir-conf:
condition: service_healthy
django:
condition: service_healthy
data-dir-conf:
image: geonode/geoserver_data:2.28.x-latest
container_name: gsconf4${COMPOSE_PROJECT_NAME}
entrypoint: sleep infinity
volumes:
- geoserver-data-dir:/geoserver_data/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "[ $$(ls -A /geoserver_data/data | wc -l) -gt 0 ] || exit 1"]
interval: 10s
timeout: 5s
retries: 3
# PostGIS database.
db:
# use geonode official postgis 15 image
image: geonode/postgis:15-3.5-latest
command: postgres -c "max_connections=${POSTGRESQL_MAX_CONNECTIONS:-200}"
container_name: db4${COMPOSE_PROJECT_NAME}
env_file:
- .env${ENVIRONMENT:+_${ENVIRONMENT}}
volumes:
- dbdata:/var/lib/postgresql/data
- dbbackups:/pg_backups
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -d postgres -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# uncomment to enable remote connections to postgres
#ports:
# - "5432:5432"
# Vanilla Redis service. This is needed by celery
redis:
image: redis:7-alpine
container_name: redis4${COMPOSE_PROJECT_NAME}
volumes:
- redisdata:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 20s
timeout: 3s
retries: 3
start_period: 5s
volumes:
statics:
name: ${COMPOSE_PROJECT_NAME}-statics
nginx-confd:
name: ${COMPOSE_PROJECT_NAME}-nginxconfd
nginx-certificates:
name: ${COMPOSE_PROJECT_NAME}-nginxcerts
geoserver-data-dir:
name: ${COMPOSE_PROJECT_NAME}-gsdatadir
dbdata:
name: ${COMPOSE_PROJECT_NAME}-dbdata
dbbackups:
name: ${COMPOSE_PROJECT_NAME}-dbbackups
backup-restore:
name: ${COMPOSE_PROJECT_NAME}-backup-restore
data:
name: ${COMPOSE_PROJECT_NAME}-data
tmp:
name: ${COMPOSE_PROJECT_NAME}-tmp
redisdata:
name: ${COMPOSE_PROJECT_NAME}-redisdata