Add compose-based dev task

This commit is contained in:
Andras Schmelczer 2026-02-07 19:02:29 +00:00
parent 091cb6f4b4
commit 7ad5b66856
2 changed files with 88 additions and 34 deletions

View file

@ -13,7 +13,21 @@ tasks:
- uv sync
- cd frontend && npm install
download:map-assets:
desc: Download font glyphs and emoji PNGs for local serving
status:
- test -d frontend/public/assets/fonts
- test -d frontend/public/assets/twemoji
cmds:
- uv run python scripts/download_map_assets.py
test:
desc: Run all tests (Python and Rust)
cmds:
- task: test:python
- task: test:server
test:python:
cmds:
- uv run -m pipeline.utils.test_fuzzy_join
- uv run pytest pipeline/utils/test_haversine.py
@ -25,37 +39,14 @@ tasks:
cmds:
- cargo test
dev:server:
desc: Run Rust backend on port 8001 (debug build, fast compile)
dir: server-rs
dev:
desc: Start all services (server, frontend, pocketbase) via Docker Compose
cmds:
- cargo run -- --data {{.WIDE_OUTPUT}} --pois {{.POIS_FILTERED_OUTPUT}} --tiles {{.TILES_OUTPUT}} --postcodes {{.POSTCODES_OUTPUT}}
- docker compose up --build
dev:server:release:
desc: Run Rust backend on port 8001 (release build)
dir: server-rs
cmds:
- cargo run --release -- --data {{.WIDE_OUTPUT}} --pois {{.POIS_FILTERED_OUTPUT}} --tiles {{.TILES_OUTPUT}} --postcodes {{.POSTCODES_OUTPUT}}
dev:og:
desc: Run OG screenshot sidecar on port 8002
dir: og-screenshot
env:
CACHE_DIR: /tmp/og-cache
NARROWIT_URL: http://localhost:3000
cmds:
- npm install
- npx playwright install --with-deps chromium
- npm run build
- npm start
dev:frontend:
desc: Run frontend dev server on port 3000 (proxies /api to :8001)
dir: frontend
deps:
- install
cmds:
- npm run dev
build:server:
desc: Build server for production

View file

@ -1,28 +1,91 @@
services:
narrowit:
build: .
server:
image: rust:1.84
working_dir: /app/server-rs
command: >
bash -c "
cargo install cargo-watch &&
cargo watch -x 'run -- --data /data/wide.parquet --pois /data/filtered_uk_pois.parquet --tiles /data/uk.pmtiles --postcodes /data/postcodes --pocketbase-url http://pocketbase:8090'
"
ports:
- "8001:8001"
networks:
- ollama-network
- dev-network
volumes:
- .:/app
- /bulk/property-data:/data:ro
- cargo-registry:/usr/local/cargo/registry
- cargo-target:/app/server-rs/target
environment:
OG_SIDECAR_URL: http://og-screenshot:8002
PUBLIC_URL: https://narrowit.schmelczer.dev
POCKETBASE_URL: http://pocketbase:8090
G_SIDECAR_URL: http://og-screenshot:8002
depends_on:
og-screenshot:
pocketbase:
condition: service_healthy
og-screenshot:
build: ./og-screenshot
build: /volumes/syncthing/Projects/property-map/og-screenshot
environment:
NARROWIT_URL: http://narrowit:8001
NARROWIT_URL: http://server:8001
CACHE_DIR: /cache
volumes:
- og-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:
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:
image: ghcr.io/muchobien/pocketbase:latest
ports:
- "8090:8090"
volumes:
- pb-data:/pb/pb_data
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8090/api/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
volumes:
pb-data:
cargo-registry:
cargo-target:
frontend-node-modules:
og-cache:
networks:
ollama-network:
dev-network: