Something went wrong. Try again.
Web frontend and supporting services for lance.blue
Something went wrong. Try again.
headquarters compose.yaml
2.6 kB · 68 lines
YAML
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869# Local development only. The deployable image is services/api/Dockerfile,# which this file deliberately does not build: a development environment that# doubles as the production artifact ends up shipping a toolchain and a source# tree. Here both services run stock images with the repo mounted in.## docker compose up# open http://127.0.0.1:5173## Ports are published on 127.0.0.1 only. That is not merely caution: in# development the OAuth client is a loopback client, whose redirect URI must be# a loopback address, so anything reachable from elsewhere on the network could# not complete a login anyway. See docs/local-dev.md.
name: lance-blue-headquarters
services: api: image: rust:1 init: true # Files land in the bind mount, so they should belong to you rather than to # root. Override if your account is not uid 1000. user: "${HQ_UID:-1000}:${HQ_GID:-1000}" working_dir: /app # The workspace lives at the repo root, so the whole repo is mounted. No # watcher: edit, then `docker compose restart api` recompiles. The cargo # cache and target dir live in the cargo-tmp volume, not the bind mount, # so recompiles are incremental and the host tree stays clean. command: cargo run -p headquarters-api environment: HOME: /tmp CARGO_HOME: /tmp/cargo CARGO_TARGET_DIR: /tmp/target RUST_LOG: "${RUST_LOG:-info}" # 0.0.0.0 is correct only here: the port publish below is what keeps the # service on loopback from the outside. BIND_ADDR: "0.0.0.0:3000" volumes: - ./:/app - cargo-tmp:/tmp ports: - "127.0.0.1:3000:3000"
web: # Debian, not alpine: node_modules is in the bind mount and shared with # host builds (web/scripts/build.sh), so the container must match the # host's libc or the two npm installs fight over native binaries. image: node:24 init: true user: "${HQ_UID:-1000}:${HQ_GID:-1000}" working_dir: /app # --host overrides the config's 127.0.0.1 bind, which is correct on a # laptop and wrong inside a container: the port publish below is what keeps # it on loopback from the outside. command: sh -c "npm install --no-audit --no-fund && npm run dev -- --host 0.0.0.0" environment: HOME: /tmp npm_config_cache: /tmp/.npm npm_config_update_notifier: "false" VITE_API_ORIGIN: "${VITE_API_ORIGIN:-http://127.0.0.1:3000}" volumes: - ./web:/app ports: - "127.0.0.1:5173:5173" depends_on: - api
volumes: cargo-tmp: