mcaxl/docs/docker-compose.yml
Ryan Malloy d597bd3569 docs deploy: exclude docs/ from sdist + pin compose project name
The Astro docs site doesn't belong in the published sdist (node_modules,
build artefacts, dev container scaffolding). Adds `docs/` to the existing
sdist exclude list, alongside the other dev-only paths.

Compose project name pinned to `mcaxl-docs` via the v2 `name:` field.
Without it, Compose defaults to the parent directory's basename — and
all three sibling docs sites live in `docs/`, so they were colliding
and cross-recreating each other on every `up`.
2026-04-29 04:48:01 -06:00

77 lines
2.3 KiB
YAML

# mcaxl docs — dev/prod via compose profiles.
#
# Mode is driven by COMPOSE_PROFILES in .env:
# COMPOSE_PROFILES=dev → hot-reload astro dev server at https://${DEV_DOMAIN}
# COMPOSE_PROFILES=prod → static site via in-container Caddy at https://${DOMAIN}
#
# Both profiles sit behind the host's external caddy-docker-proxy on the
# `caddy` network. mcaxl is a public OSS project; no basic auth.
#
# Prerequisite: `docker network create caddy` (one-time, shared with the
# edge caddy-docker-proxy instance).
# Explicit project name. Without this, Compose defaults to the parent
# directory's basename — and all three docs sites live in `docs/`, so
# they would collide and cross-recreate each other on every `up`.
name: mcaxl-docs
services:
docs-dev:
profiles: ["dev"]
build:
context: .
dockerfile: Dockerfile
target: dev
image: ${COMPOSE_PROJECT}-dev
container_name: ${COMPOSE_PROJECT}-dev
restart: unless-stopped
environment:
ASTRO_TELEMETRY_DISABLED: "1"
NODE_ENV: development
DOMAIN: ${DEV_DOMAIN} # Vite HMR binds wss://${DEV_DOMAIN}:443
volumes:
- .:/app
- /app/node_modules
- /app/.astro
networks:
- caddy
labels:
caddy: ${DEV_DOMAIN}
caddy.reverse_proxy: "{{upstreams 4321}}"
# ── HMR-through-Caddy streaming tweaks ──
# Vite HMR doesn't send app-level pings; Caddy closes idle WebSockets
# after ~10-15s without these. Refs in ~/.claude/CLAUDE.md.
caddy.reverse_proxy.flush_interval: "-1"
caddy.reverse_proxy.transport: "http"
caddy.reverse_proxy.transport.read_timeout: "0"
caddy.reverse_proxy.transport.write_timeout: "0"
caddy.reverse_proxy.transport.keepalive: "5m"
caddy.reverse_proxy.transport.keepalive_idle_conns: "10"
caddy.reverse_proxy.stream_timeout: "24h"
caddy.reverse_proxy.stream_close_delay: "5s"
caddy.encode: "gzip zstd"
docs-prod:
profiles: ["prod"]
build:
context: .
dockerfile: Dockerfile
target: prod
args:
DOMAIN: ${DOMAIN}
image: ${COMPOSE_PROJECT}-prod
container_name: ${COMPOSE_PROJECT}-prod
restart: unless-stopped
networks:
- caddy
labels:
caddy: ${DOMAIN}
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.encode: "gzip zstd"
networks:
caddy:
external: true