Files
maptool/docker-compose.yaml
T
randy 9997a8a8c0
CI / check (push) Successful in 41s
CI / deploy (push) Successful in 12s
Fix note UX: unreachable wiki link, white Save hover, stale icon preview, invisible new points
- "Nearby on Wikipedia" linked to KIWIX_URL, a Docker-internal hostname
  (http://kiwix:8080) no real browser can resolve. Split it: KIWIX_URL
  stays server-side-only for the reachability check, and the link
  itself is built from KIWIX_PUBLIC_PORT (kiwix-serve's newly
  published host port) plus whatever host the visitor already used to
  reach maptool — works regardless of which hostname/IP that is.
- The Save button went white on hover in GTK-themed Chrome: the
  browser's native button skin was painting over the custom
  background because appearance wasn't reset.
- The map preview marker for a pending note always showed a plain red
  pin no matter which icon was picked in the form. NoteSaveForm now
  reports icon changes via onIconChange so NotesControl can update the
  marker's glyph live.
- Saving a note (or a Measure "Save as note") left the new/grown
  .geojson file unchecked and invisible until manually toggled on.
  notifyGpxStoreChanged now carries the affected path so
  GpxPanelControl auto-shows it.
2026-09-09 15:11:50 +02:00

104 lines
5.7 KiB
YAML

services:
maptool:
# "./build", not ".": the compose file's own context ("." would mean
# the symlink's directory, /srv/podman/maptool/ — see docs/deployment.adoc)
# is one level above where the actual checkout (and its Dockerfile)
# lives since the previous commit moved it into build/. Volume paths
# below resolve against that same symlink directory too, but a relative
# *build context* specifically needs pointing at build/ itself — the
# gap this fixes: production's compose up --build failed outright
# ("lstat .../maptool/Dockerfile: no such file or directory") until this
# was caught, since only the volume-path resolution got dry-run tested
# before the previous commit shipped, not this one.
build: ./build
image: maptool:latest
restart: unless-stopped
ports:
- "4567:4567"
environment:
# "[::]", not "0.0.0.0": binding the IPv6 wildcard also accepts IPv4
# connections (dual-stack is the Linux default), so this covers both
# without a second listener. Puma's bind URL needs the brackets around
# a literal IPv6 address (config/puma.rb interpolates this as-is).
BIND_HOST: "[::]"
RACK_ENV: production
# Read from .env (docker compose loads it automatically) — not
# committed, see docs/deployment.adoc.
SESSION_SECRET: ${SESSION_SECRET:?SESSION_SECRET is required, see docs/deployment.adoc}
GITEA_OAUTH_CLIENT_ID: ${GITEA_OAUTH_CLIENT_ID:?GITEA_OAUTH_CLIENT_ID is required, see docs/deployment.adoc}
GITEA_OAUTH_CLIENT_SECRET: ${GITEA_OAUTH_CLIENT_SECRET:?GITEA_OAUTH_CLIENT_SECRET is required, see docs/deployment.adoc}
MAPTOOL_ALLOWED_GITEA_USER: ${MAPTOOL_ALLOWED_GITEA_USER:?MAPTOOL_ALLOWED_GITEA_USER is required, see docs/deployment.adoc}
# Optional: blank disables the LiveTrack webhook endpoint rather than
# failing to start, since it's not needed for the app's core function.
LIVETRACK_WEBHOOK_SECRET: ${LIVETRACK_WEBHOOK_SECRET:-}
# The kiwix service below, reached by its compose service name (both
# are on the same default compose network) — port matches its own
# --port=8080 in the command below. Not made conditional on the ZIM
# actually being present: GET /api/kiwix pings it and just reports
# unavailable if the container isn't up/reachable, same story as
# every other optional-local-file feature (offline.pmtiles, etc).
# Server-side reachability check only — a browser on the LAN can't
# resolve this hostname, see KIWIX_PUBLIC_PORT below.
KIWIX_URL: "http://kiwix:8080"
# The host port kiwix's own ports: mapping below publishes it on —
# app.rb builds the browser-facing "Nearby on Wikipedia" link from
# whatever host the visitor used to reach maptool itself plus this
# port, since KIWIX_URL above is Docker-internal only.
KIWIX_PUBLIC_PORT: "8090"
volumes:
# Uploaded GPX files and the offline PMTiles extract — kept outside
# the image so a rebuild/redeploy doesn't wipe them (see
# docs/development.adoc for how the deploy job treats this
# directory).
- ./data:/app/data
# Fakes a GNSS fix (a loop around Bratislava, see
# bin/gnss_simulator.rb/docs/development.adoc) since there's no real
# receiver attached here — the "GNSS" control would otherwise just show
# "no fix" always. Remove this service (and nothing else) whenever a real
# receiver/gpsd setup replaces it. network_mode ties it to maptool's own
# network namespace rather than a bridge network, since GpsdClient
# connects to a hardcoded 127.0.0.1:2947 — same as gpsd itself normally
# being local to the machine it serves.
gnss-simulator:
image: maptool:latest
depends_on:
- maptool
restart: unless-stopped
network_mode: "service:maptool"
command: ["ruby", "bin/gnss_simulator.rb"]
# Serves an offline Wikipedia ZIM for the popup's "Nearby on Wikipedia"
# link (see docs/development.adoc for where to get one and drop it in —
# same "not part of the repo, place it under ./data locally" story as
# offline.pmtiles/terrain.pmtiles). On the default compose network (not
# network_mode: "service:maptool" — unlike gnss-simulator this doesn't
# need a hardcoded localhost port, KIWIX_URL above reaches it by this
# service's own name), so maptool and kiwix stay independent containers.
# Keeps restarting (harmlessly) if data/kiwix/wikipedia.zim isn't there
# yet — GET /api/kiwix just reports unavailable until it comes up.
#
# The volume binds the exact *file* path, not the data/kiwix/ directory —
# deliberately, so data/kiwix/wikipedia.zim can be a symlink to wherever
# the (large) real ZIM actually lives. A bind mount resolves a symlink at
# its *source* path once, at mount time (plain mount(2) semantics, same
# as Podman); a symlink sitting inside an already-mounted directory
# doesn't get that treatment — the container would have to resolve it
# itself, inside its own filesystem, where the host path it points to
# doesn't exist.
kiwix:
image: ghcr.io/kiwix/kiwix-serve:latest
restart: unless-stopped
# No --port here: the image's own start.sh already prepends
# --port=8080 (its default) before appending this command array, so
# passing it again produced "Unexpected argument: --port=8080,
# --port=8080, /data/wikipedia.zim" and kiwix-serve refused to start.
command: ["/data/wikipedia.zim"]
# Published so browsers on the LAN can reach kiwix-serve's own search
# UI directly (see maptool's KIWIX_PUBLIC_PORT above) — 8090, not 8080,
# since 8080 is already taken by another container on this host.
ports:
- "8090:8080"
volumes:
- ./data/kiwix/wikipedia.zim:/data/wikipedia.zim