Hostityourself/infra/docker-compose.yml
Claude 588e74a626
Multi-platform Docker build: amd64, arm64, armv7, armv6
Dockerfile now uses BuildKit TARGETARCH/TARGETVARIANT to pick the Rust
cross-compilation target automatically. The build stage always runs on
the host platform for speed.

Makefile provides named targets:
  make up-amd64   # Mac Intel / Linux desktop
  make up-arm64   # Mac M1/M2/M3, Pi 4/5 (64-bit OS)
  make up-armv7   # Pi 2/3/4 (32-bit OS)
  make up-armv6   # Pi Zero / Pi 1
2026-03-20 09:55:53 +00:00

75 lines
2.3 KiB
YAML

# HIY — local development stack
# Run with: docker compose up --build
#
# On a real Pi you would run Caddy as a systemd service; here it runs in Compose
# so you can develop without changing the host.
services:
# ── Docker socket proxy (unix → TCP) ──────────────────────────────────────
docker-proxy:
image: alpine/socat
command: tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- hiy-net
# ── Control plane ─────────────────────────────────────────────────────────
server:
platform: ${PLATFORM:-linux/amd64}
build:
context: ..
dockerfile: infra/Dockerfile.server
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- hiy-data:/data
# Mount the builder script so edits take effect without rebuilding.
- ../builder:/app/builder:ro
environment:
HIY_DATA_DIR: /data
HIY_ADDR: 0.0.0.0:3000
HIY_BUILD_SCRIPT: /app/builder/build.sh
CADDY_API_URL: http://caddy:2019
DOCKER_HOST: tcp://docker-proxy:2375
DOMAIN_SUFFIX: ${DOMAIN_SUFFIX:-localhost}
RUST_LOG: hiy_server=debug,tower_http=info
depends_on:
caddy:
condition: service_started
docker-proxy:
condition: service_started
networks:
- hiy-net
- default
# ── Reverse proxy ─────────────────────────────────────────────────────────
caddy:
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "2019:2019" # admin API
volumes:
- ../proxy/caddy.json:/etc/caddy/caddy.json:ro
- caddy-data:/data
- caddy-config:/config
command: caddy run --config /etc/caddy/caddy.json
networks:
- hiy-net
- default
networks:
hiy-net:
name: hiy-net
# External so deployed app containers can join it.
external: false
volumes:
hiy-data:
caddy-data:
caddy-config: