-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcompose.prod.yml
More file actions
135 lines (128 loc) · 5.75 KB
/
Copy pathcompose.prod.yml
File metadata and controls
135 lines (128 loc) · 5.75 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
# spieli — production stack (pre-built images, no local source required)
#
# Usage:
# bash install.sh # interactive first-time setup (recommended)
#
# Manual usage after install.sh has created your .env:
# docker compose -f compose.prod.yml --profile data-node-ui up -d
# docker compose -f compose.prod.yml --profile data-node run --rm importer
#
# Images are published to ghcr.io on every push to main (tagged :rc) and on
# every tagged release (tagged :latest + semver). Pin to a semver tag for
# reproducible deploys.
services:
# ── PostGIS database ────────────────────────────────────────────────────────
db:
image: postgis/postgis:16-3.4-alpine
profiles: [data-node, data-node-ui]
# Tuning GUCs are applied via ALTER SYSTEM in importer/api.sql.
environment:
POSTGRES_DB: osm
POSTGRES_USER: osm
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-CHANGE_ME}
volumes:
- pgdata:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/10_init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U osm -d osm"]
interval: 10s
timeout: 5s
retries: 10
restart: unless-stopped
# ── OSM importer (run manually; not started by default) ─────────────────────
# docker compose -f compose.prod.yml --profile data-node run --rm importer
importer:
image: ghcr.io/mfuhrmann/spieli-importer:latest
profiles: [data-node, data-node-ui]
depends_on:
db:
condition: service_healthy
environment:
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_DB: osm
POSTGRES_USER: osm
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-CHANGE_ME}
PBF_URL: ${PBF_URL}
OSM2PGSQL_THREADS: ${OSM2PGSQL_THREADS:-4}
OSM_RELATION_ID: ${OSM_RELATION_ID}
PG_MAX_PARALLEL_WORKERS: ${PG_MAX_PARALLEL_WORKERS:-6}
PG_MAX_PARALLEL_WORKERS_PER_GATHER: ${PG_MAX_PARALLEL_WORKERS_PER_GATHER:-4}
PG_MAX_PARALLEL_MAINTENANCE_WORKERS: ${PG_MAX_PARALLEL_MAINTENANCE_WORKERS:-4}
PG_MAINTENANCE_WORK_MEM: ${PG_MAINTENANCE_WORK_MEM:-512MB}
PG_WORK_MEM: ${PG_WORK_MEM:-128MB}
# Set both to enable daemon mode (automatic recurring re-imports).
# When unset (default) the importer runs once and exits (one-shot mode).
REIMPORT_INTERVAL_MIN_DAYS: ${REIMPORT_INTERVAL_MIN_DAYS:-}
REIMPORT_INTERVAL_MAX_DAYS: ${REIMPORT_INTERVAL_MAX_DAYS:-}
IMPRESSUM_NAME: ${IMPRESSUM_NAME:-}
IMPRESSUM_ORG: ${IMPRESSUM_ORG:-}
IMPRESSUM_ADDRESS: ${IMPRESSUM_ADDRESS:-}
IMPRESSUM_EMAIL: ${IMPRESSUM_EMAIL:-}
IMPRESSUM_PHONE: ${IMPRESSUM_PHONE:-}
IMPRESSUM_URL: ${IMPRESSUM_URL:-}
PRIVACY_URL: ${PRIVACY_URL:-}
SITE_URL: ${SITE_URL:-}
volumes:
- pbf_cache:/data
# on-failure: retries crashed imports; exits-0 (one-shot success) are not restarted.
# In daemon mode the script loops forever — on-failure only fires on an actual crash.
restart: on-failure
# ── Watchtower — optional automatic image updates ────────────────────────────
# Pulls updated spieli images daily and restarts affected containers.
# The importer's startup grace check prevents an unplanned re-import when
# the container is restarted by Watchtower after an image update.
# Enable with: --profile auto-update (set by install.sh when operator opts in).
watchtower:
image: containrrr/watchtower
profiles: [auto-update]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
WATCHTOWER_POLL_INTERVAL: 86400
WATCHTOWER_CLEANUP: "true"
DOCKER_API_VERSION: "1.47"
restart: unless-stopped
# ── PostgREST — auto-generates REST API from the api schema ─────────────────
postgrest:
image: postgrest/postgrest:v12.2.0
profiles: [data-node, data-node-ui]
depends_on:
db:
condition: service_healthy
environment:
PGRST_DB_URI: postgres://osm:${POSTGRES_PASSWORD}@db:5432/osm
PGRST_DB_SCHEMA: api
PGRST_DB_ANON_ROLE: web_anon
PGRST_SERVER_PORT: 3000
PGRST_LOG_LEVEL: warn
restart: unless-stopped
# ── Svelte app — serves the frontend and proxies /api/ to PostgREST ─────────
app:
image: ghcr.io/mfuhrmann/spieli:latest
profiles: [ui, data-node-ui]
ports:
- "${APP_PORT:-8080}:80"
environment:
APP_MODE: ${APP_MODE:-standalone}
OSM_RELATION_ID: ${OSM_RELATION_ID}
REGION_PLAYGROUND_WIKI_URL: ${REGION_PLAYGROUND_WIKI_URL:-}
REGION_CHAT_URL: ${REGION_CHAT_URL:-}
MAP_ZOOM: ${MAP_ZOOM:-12}
MAP_MIN_ZOOM: ${MAP_MIN_ZOOM:-10}
POI_RADIUS_M: ${POI_RADIUS_M:-5000}
API_BASE_URL: ${API_BASE_URL:-/api}
REGISTRY_URL: ${REGISTRY_URL:-/registry.json}
HUB_POLL_INTERVAL: ${HUB_POLL_INTERVAL:-300}
SITE_URL: ${SITE_URL:-}
IMPRESSUM_NAME: ${IMPRESSUM_NAME:-}
IMPRESSUM_ORG: ${IMPRESSUM_ORG:-}
IMPRESSUM_ADDRESS: ${IMPRESSUM_ADDRESS:-}
IMPRESSUM_EMAIL: ${IMPRESSUM_EMAIL:-}
IMPRESSUM_PHONE: ${IMPRESSUM_PHONE:-}
IMPRESSUM_URL: ${IMPRESSUM_URL:-}
PRIVACY_URL: ${PRIVACY_URL:-}
restart: on-failure
volumes:
pgdata:
pbf_cache: