This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
224 lines (212 loc) · 5.96 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
networks:
osm-net:
name: osm-net
volumes:
osm-tmp:
osm-storage:
osm-config:
osm-db-data:
certs:
certbot_data:
services:
proxy:
image: "ghcr.io/hotosm/osm-sandbox/proxy:debug"
profiles: [""]
build:
context: nginx
target: debug
args:
NGINX_TAG: "${NGINX_TAG:-1.25.3}"
depends_on:
osm:
condition: service_started
osm-cgi:
condition: service_started
ports:
- ${OSM_DEV_PORT:-4433}:80
networks:
- osm-net
restart: "unless-stopped"
proxy-ssl:
image: "ghcr.io/hotosm/osm-sandbox/proxy:latest"
profiles: [public]
build:
context: nginx
target: latest
args:
NGINX_TAG: "${NGINX_TAG:-1.25.3}"
depends_on:
osm:
condition: service_started
osm-cgi:
condition: service_started
certbot:
condition: service_completed_successfully
volumes:
- certs:/etc/letsencrypt
- certbot_data:/var/www/certbot
environment:
DOMAIN: ${DOMAIN}
ports:
- 80:80
- 443:443
networks:
- osm-net
restart: "unless-stopped"
osm:
image: "ghcr.io/hotosm/osm-sandbox:2024.4.30"
build: .
depends_on:
osm-db:
condition: service_healthy
environment:
PROTOCOL: http${DOMAIN:+s}
# NOTE for development this must be 127.0.0.1 due to
# OSM oauth config restrictions
DOMAIN: ${DOMAIN:-127.0.0.1:4433}
ADMIN_EMAIL: ${ADMIN_EMAIL:[email protected]}
ADMIN_PASS: ${ADMIN_PASS:-Password1234}
ID_EDITOR_REDIRECT_URI: http${DOMAIN:+s}://${DOMAIN:-127.0.0.1:4433}
volumes:
# Mount a tmp directory that will persist between runs
- osm-tmp:/app/tmp
# Mount a storage directory that will persist between runs
- osm-storage:/app/storage
# Mount config between containers
- osm-config:/app/config
# Mount local setting overrides
# - ./settings.local.yml:/app/config/settings.local.yml:ro
tmpfs:
/tmp/pids/
networks:
- osm-net
restart: unless-stopped
healthcheck:
test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/3000' || exit 1
interval: 5s
retries: 3
start_period: 5s
timeout: 5s
osm-jobs:
image: "ghcr.io/hotosm/osm-sandbox:2024.4.30"
depends_on:
osm:
condition: service_healthy
volumes:
# Mount a tmp directory that will persist between runs
- osm-tmp:/app/tmp
# Mount a storage directory that will persist between runs
- osm-storage:/app/storage
# Mount config between containers
- osm-config:/app/config
# Mount local setting overrides
# - ./settings.local.yml:/app/config/settings.local.yml:ro
tmpfs:
/tmp/pids/
networks:
- osm-net
restart: unless-stopped
entrypoint: /bin/sh -c
command:
- |
# First delay 30 seconds to ensure settings configured
echo "Waiting 30 seconds..."
timeout 30s
echo "Running background worker"
bundle exec rake jobs:work
osm-cgi:
image: "ghcr.io/hotosm/osm-sandbox/cgimap:${CGIMAP_VERSION:-v2.0.1}"
build:
context: https://github.com/zerebubuth/openstreetmap-cgimap.git#${CGIMAP_VERSION:-v2.0.1}
dockerfile: docker/debian/Dockerfile_bookworm
depends_on:
osm-db:
condition: service_healthy
environment:
CGIMAP_HOST: osm-db
CGIMAP_DBNAME: openstreetmap
CGIMAP_USERNAME: openstreetmap
CGIMAP_PASSWORD: openstreetmap
CGIMAP_MEMCACHE: memcached
CGIMAP_RATELIMIT: 204800
CGIMAP_MAXDEBT: 250
CGIMAP_MODERATOR_RATELIMIT: 1048576
CGIMAP_MODERATOR_MAXDEBT: 1024
CGIMAP_PORT: 8000
CGIMAP_INSTANCES: 3
networks:
- osm-net
restart: unless-stopped
# Override from https://github.com/zerebubuth/openstreetmap-cgimap/blob/master/docker/debian/Dockerfile_bookworm
# defaults: --max-payload 50000000L (50MB) --max-changeset-elements 10000
# --map-nodes 50000 --map-area 0.25 (square degrees)
# Note the Ruby server max-changeset-elements is hardcoded (but this config should override it):
# https://github.com/openstreetmap/openstreetmap-website/blob/cee9818dfc9ac3f6eae01cdb51df9093ae5d1322/app/models/changeset.rb#L58
entrypoint: >
sh -c "/usr/bin/openstreetmap-cgimap --pidfile /tmp/cgimap.pid \
--logfile=/proc/1/fd/1 --daemon \
--max-payload 500000000 --max-changeset-elements 1000000 \
--map-nodes 10000000 --map-area 10 && \
tail --pid=\$(cat /tmp/cgimap.pid) -f /dev/null"
# importer:
# image: "ghcr.io/hotosm/osm-sandbox/importer:latest"
# build:
# context: importer
# depends_on:
# osm:
# condition: service_healthy
# networks:
# - osm-net
# restart: unless-stopped
# entrypoint: sleep infinity
osm-db:
image: docker.io/postgres:14
environment:
POSTGRES_DB: openstreetmap
POSTGRES_PASSWORD: openstreetmap
POSTGRES_USER: openstreetmap
volumes:
- osm-db-data:/var/lib/postgresql/data
networks:
- osm-net
ports:
- 54321:5432
restart: unless-stopped
healthcheck:
test: pg_isready -U openstreetmap -d openstreetmap
start_period: 5s
interval: 10s
timeout: 5s
retries: 3
mail:
image: "ixdotai/smtp:v0.5.2"
volumes:
- ./rsa.private:/etc/exim4/dkim.key.temp:ro
environment:
- MAILNAME=${DOMAIN:-hotosm.org}
- DKIM_KEY_PATH=/etc/exim4/dkim.key.temp
networks:
- osm-net
restart: unless-stopped
memcached:
image: "docker.io/memcached:1.6"
# ports:
# - 11211:11211
networks:
- osm-net
restart: unless-stopped
certbot:
image: "ghcr.io/hotosm/osm-sandbox/proxy:certs-init"
profiles: [public]
volumes:
- certs:/etc/letsencrypt
- certbot_data:/var/www/certbot
environment:
DOMAIN: ${DOMAIN}
CERT_EMAIL: ${CERT_EMAIL}
ports:
- 80:80
- 443:443
networks:
- osm-net
restart: "on-failure:2"