# GeoMetrikks — user-facing compose. Quickstart: # mkdir geometrikks && cd geometrikks # curl -LO https://raw.githubusercontent.com/GilbN/geometrikks/main/docker-compose.yml # curl -Lo .env https://raw.githubusercontent.com/GilbN/geometrikks/main/.env.example # $EDITOR .env # set APP_ADMIN_PASSWORD, MaxMind key, log path # docker compose up -d # # ./logs on the host holds the application log and login.log, readable by # host-side tools like CrowdSec/fail2ban. The container chowns it to # PUID:PGID (default 1000:1000) at startup; set PUID/PGID in .env to match # your host user if you want different ownership. # # Developing GeoMetrikks itself? Use docker-compose.dev.yml instead. services: timescale_db: image: timescale/timescaledb-ha:pg18 restart: unless-stopped shm_size: 256mb # GeoMetrikks registers ~32 TimescaleDB background jobs and its CAGG # refresh policies all fire on the same tick; the image's default pool # (timescaledb.max_background_workers=16) is too small for that burst # and logs "failed to launch job ... out of background workers". # max_worker_processes must hold the whole pool: background workers + # max_parallel_workers + 3 internal processes. command: - -c - timescaledb.max_background_workers=40 - -c - max_parallel_workers=8 - -c - max_worker_processes=51 environment: POSTGRES_USER: geouser POSTGRES_PASSWORD: ${DB_PASSWORD:-geopass} POSTGRES_DB: geometrikks volumes: - timescale_data:/home/postgres/pgdata/data healthcheck: test: ["CMD-SHELL", "pg_isready -U geouser -d geometrikks"] interval: 5s timeout: 5s retries: 5 app: image: ghcr.io/gilbn/geometrikks:latest restart: unless-stopped hostname: geometrikks environment: DB_HOST: timescale_db DB_PASSWORD: ${DB_PASSWORD:-geopass} PUID: ${PUID:-1000} PGID: ${PGID:-1000} ports: - "8000:8000" env_file: - .env volumes: - geoip_data:/app/data/geoip - ${ACCESS_LOG_DIR:-${NGINX_LOG_DIR:-/var/log/nginx}}:/var/log/access:ro # Exposes the application log and login.log on the host for tools like # CrowdSec/fail2ban, and persists them across container recreation. - ./logs:/app/logs depends_on: timescale_db: condition: service_healthy # Granian is started with --workers-kill-timeout 15; the default 10s # stop timeout SIGKILLs the container mid-teardown and drops the # ingestion batch still in flight. stop_grace_period: 20s volumes: timescale_data: geoip_data: