-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
168 lines (158 loc) · 5.35 KB
/
Copy pathdocker-compose.yml
File metadata and controls
168 lines (158 loc) · 5.35 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
services:
postgres:
image: postgres:18
restart: unless-stopped
environment:
POSTGRES_DB: meshinfo
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
# Postgres memory tuning — conservative defaults; size to host via .env (see POSTGRES.md).
command:
- "postgres"
- "-c"
- "shared_buffers=${PG_SHARED_BUFFERS:-256MB}"
- "-c"
- "work_mem=${PG_WORK_MEM:-8MB}"
- "-c"
- "maintenance_work_mem=${PG_MAINTENANCE_WORK_MEM:-64MB}"
- "-c"
- "effective_cache_size=${PG_EFFECTIVE_CACHE_SIZE:-1GB}"
# No published port: the app reaches Postgres over the compose network,
# and docker-published ports bypass host firewalls (ufw). For host access
# use `docker compose exec postgres psql -U postgres meshinfo`, or map
# "127.0.0.1:5432:5432" in a docker-compose.override.yml.
volumes:
# postgres:18+ stores data in a version-specific subdir; mount the
# parent (/var/lib/postgresql), not /data. See POSTGRES.md.
- meshinfo_pgdata:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d meshinfo"]
interval: 5s
timeout: 5s
retries: 20
mqtt:
container_name: mqtt
image: eclipse-mosquitto:latest
# 1883 stays published on all interfaces by design — mesh gateways on the
# WAN publish uplinks here. Protect it with broker auth: see the
# password_file/acl_file notes in mosquitto/config/mosquitto.conf.sample.
ports:
- 1883:1883
volumes:
- ./mosquitto/data:/mosquitto/data:rw
- ./mosquitto/config:/mosquitto/config:rw
restart: unless-stopped
meshinfo:
image: ghcr.io/meshaddicts/meshinfo:latest
volumes:
- ./config.toml:/app/config.toml
- ./output:/app/output
- ./postgres:/app/postgres:ro
# In-app scheduled pg_dump snapshots land here ([backups] in config.toml).
- ./backups:/app/backups
environment:
- PYTHONUNBUFFERED=1
# Uncomment if node enrichment fails with "Name or service not known"
# (some Docker setups don't inherit host DNS for external lookups)
# dns:
# - 1.1.1.1
# - 1.0.0.1
# Localhost-only: caddy is the public entry for the API (/v1, /api, /tiles).
# Docker-published ports bypass host firewalls, so don't expose 9000 directly.
ports:
- 127.0.0.1:9000:9000
restart: unless-stopped
# Wait for Postgres readiness, not just container start.
depends_on:
postgres:
condition: service_healthy
mqtt:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "python3 -c 'import urllib.request,sys; sys.exit(0 if urllib.request.urlopen(\"http://localhost:9000/\", timeout=3).status==200 else 1)'"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
frontend:
image: ghcr.io/meshaddicts/meshinfo-spa:latest
# Localhost-only: caddy is the public entry for the SPA.
ports:
- 127.0.0.1:8000:80
env_file:
- path: ./frontend/.env
required: false
environment:
NODE_ENV: production
restart: unless-stopped
caddy:
build:
context: .
dockerfile: Dockerfile.caddy
ports:
- 80:80
- 443:443
volumes:
- ./caddy/data:/data/caddy
- ./Caddyfile:/etc/caddy/Caddyfile
- ./public/images:/srv/images
# Maintenance landing page + toggle flag (see scripts/maintenance.sh).
- ./public/maintenance:/srv/maintenance:ro
environment:
- CADDY_AGREE=true
restart: unless-stopped
depends_on:
meshinfo:
condition: service_healthy
frontend:
condition: service_started
# `docker compose --profile bake run --rm landcover-bake` — see scripts/README-landcover.md.
landcover-bake:
profiles: ["bake"]
build:
context: .
dockerfile: Dockerfile.landcover
volumes:
- ./output:/app/output
# `docker compose --profile bake run --rm canopy-bake` — see scripts/README-canopy.md.
canopy-bake:
profiles: ["bake"]
build:
context: .
dockerfile: Dockerfile.canopy
volumes:
- ./output:/app/output
# `docker compose --profile bake run --rm building-bake` — see scripts/README-buildings.md.
building-bake:
profiles: ["bake"]
build:
context: .
dockerfile: Dockerfile.buildings
volumes:
- ./output:/app/output
# Live network-coverage tile baker (opt-in; CPU-heavy). Start with:
# docker compose --profile coverage up -d --build coverage-worker
# Set [coverage] enabled = true in config.toml so meshinfo serves /tiles/coverage.
coverage-worker:
profiles: ["coverage"]
build:
context: .
dockerfile: Dockerfile.coverage
volumes:
- ./output:/output
environment:
- MESHINFO_URL=http://meshinfo:9000
- COVERAGE_OUTPUT_DIR=/output/coverage
- COVERAGE_RECENCY_HOURS=4
# Single-region deployments need no clip. Set COVERAGE_BBOX="west,south,east,north"
# only if this instance's DB aggregates multiple disjoint regions.
# Low-memory hosts: set COVERAGE_DEM_SIZE=4096 and COVERAGE_NODE_OUTPUT=1024.
# Half-weight CPU so meshinfo/postgres win under contention; for a hard cap
# on shared hosts add `cpus: N` + COVERAGE_WORKERS=N.
cpu_shares: 512
restart: unless-stopped
depends_on:
meshinfo:
condition: service_healthy
volumes:
meshinfo_pgdata: