perfect-postcode/docker-compose.yml
2026-02-15 22:39:53 +00:00

177 lines
4.4 KiB
YAML

x-credentials:
pb-email: &pb-email admin@propertymap.local
pb-password: &pb-password propertymap-dev-2024
services:
server:
image: rust:1.84
init: true
working_dir: /app/server-rs
command: >
bash -c "
cargo install cargo-watch &&
cargo watch -x 'run -- --data /app/data/wide.parquet --pois /app/data/filtered_uk_pois.parquet --places /app/data/places.parquet --tiles /app/data/uk.pmtiles --postcodes /app/data/postcode_boundaries'
"
ports:
- "8001:8001"
networks:
- dev-network
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- .:/app
- cargo-registry:/usr/local/cargo/registry
- cargo-target:/app/server-rs/target
- ./property-data:/app/data:ro
environment:
POCKETBASE_URL: http://pocketbase:8090
POCKETBASE_ADMIN_EMAIL: *pb-email
POCKETBASE_ADMIN_PASSWORD: *pb-password
SCREENSHOT_URL: http://screenshot:8002
OLLAMA_URL: http://host.docker.internal:11434
OLLAMA_MODEL: gpt-oss:20b
PUBLIC_URL: https://perfectpostcodes.schmelczer.dev
R5_URL: http://r5:8003
GOOGLE_MAPS_API_KEY: "AIzaSyBgBn9LjrxHCjb9j1LZbLYpEdCJj-NkHPY"
depends_on:
pocketbase:
condition: service_healthy
screenshot:
init: true
build: /volumes/syncthing/Projects/property-map/screenshot
environment:
APP_URL: http://frontend:3001
CACHE_DIR: /cache
volumes:
- screenshot-cache:/cache
networks:
- dev-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8002/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [ gpu ]
count: 1
frontend:
init: true
image: node:22-slim
working_dir: /app/frontend
command: >
bash -c "
npm install &&
npm run dev
"
ports:
- "3001:3001"
networks:
- dev-network
volumes:
- .:/app
- frontend-node-modules:/app/frontend/node_modules
environment:
API_PROXY_TARGET: http://server:8001
PB_PROXY_TARGET: http://pocketbase:8090
pocketbase:
init: true
image: ghcr.io/muchobien/pocketbase:latest
ports:
- "8090:8090"
volumes:
- pb-data:/pb/pb_data
networks:
- dev-network
environment:
PB_ADMIN_EMAIL: *pb-email
PB_ADMIN_PASSWORD: *pb-password
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8090/api/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
gluetun:
image: qmcgaw/gluetun:v3.40.4
volumes:
- gluetun-cache-v2:/gluetun
- gluetun-auth:/gluetun/auth:ro
environment:
# See https://github.com/qdm12/gluetun-wiki/tree/main/setup#setup
VPN_SERVICE_PROVIDER: mullvad
VPN_TYPE: wireguard
WIREGUARD_PRIVATE_KEY: "8FFKmtTvDsZlShnKl/opDDwCwb9v2ox4+Kkl3wX+9Gw="
WIREGUARD_ADDRESSES: "10.66.109.86/32"
OWNED_ONLY: "yes"
UPDATER_PERIOD: 24h
SERVER_COUNTRIES: Serbia,Slovakia,Croatia,Austria,Denmark,Finland
TZ: $TIME_ZONE
restart: unless-stopped
ports:
- "1234:1234"
healthcheck:
test: "wget -q https://www.google.com || exit 1"
interval: 1m
timeout: 15s
retries: 2
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
finder:
build: ./finder
init: true
network_mode: service:gluetun
volumes:
- ./finder:/app
- ./property-data/arcgis_data.parquet:/data/arcgis_data.parquet:ro
depends_on:
gluetun:
condition: service_healthy
restart: unless-stopped
r5:
init: true
build: ./r5-java
ports:
- "8004:8003"
networks:
- dev-network
volumes:
- r5-network:/data/network
- ./property-data/transit:/data/transit:ro
- ./property-data/transit/raw:/data/transit-raw:ro
environment:
DATA_DIR: /data/transit
OSM_DIR: /data/transit-raw
NETWORK_CACHE_DIR: /data/network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8003/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 300s
volumes:
pb-data:
cargo-registry:
cargo-target:
frontend-node-modules:
screenshot-cache:
r5-network:
gluetun-cache-v2:
gluetun-auth:
networks:
dev-network: