Files
faunosteo/docker-compose.yml
T
bchanot 3e48b0d848 chore(workspace): DEV least-privilege exposure — nginx DEV gateway (API on the LAN, Mailpit behind basic auth), network check from a distinct origin, loopback default for the rootless daemon documented
The Supabase CLI publishes 54321-54324 on every interface with no bind
option. Design: the rootless daemon binds published ports on loopback by
default (~/.config/docker/daemon.json {"ip":"127.0.0.1"}, owner action,
not applied), and the DEV gateway (Compose service dev-gateway, profile
dev, container faunosteo_dev_gateway) re-publishes only the API (Kong) and
Mailpit behind HTTP basic auth on FAUNOSTEO_DEV_HOST; Studio and PostgreSQL
stay loopback (SSH tunnel for Studio). pnpm dev:gateway generates the Mailpit
credentials (gitignored; htpasswd 644 because the rootless container user
cannot read a 600 file, hash only). pnpm dev:net-check probes from a
throwaway container on its own Docker network: app, API health, REST 401,
Mailpit 401/200, PostgreSQL and Studio closed. Gateway proven on alternate
ports (health 200, password login 200, Mailpit 401 / 200).
2026-10-13 22:38:40 +02:00

69 lines
2.3 KiB
YAML

# Every Faunosteo-owned Docker resource is named `faunosteo_*` (DEPLOY.md
# "Docker resource naming"): project name = network / default volume prefix.
name: faunosteo
services:
app:
container_name: faunosteo_app
build:
context: .
dockerfile: Dockerfile
ports:
- "${PORT:-8080}:${PORT:-8080}"
env_file:
- .env
restart: unless-stopped
# Files worker (plan Step 8 / Rust R1, docs/development/STORAGE.md §3): the keyed
# job loop and the keyless decode child, one static binary on distroless. Started
# only with the `worker` profile: `docker compose --profile worker up -d worker`.
# It joins the Supabase compose network (never a published port) and reads its
# own env file, separate from the app's: SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY,
# WORKER_ID (chmod 600, excluded from any backup copy of env files).
worker:
container_name: faunosteo_worker
profiles: ["worker"]
build:
context: .
dockerfile: crates/worker/Dockerfile
image: faunosteo_worker:local
env_file:
- .env.worker
command: ["run"]
read_only: true
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
mem_limit: 512m
cpus: 1
pids_limit: 64
networks:
- supabase
restart: unless-stopped
# DEV gateway (docs/development/ENVIRONMENTS.md §3): with the rootless daemon binding
# published ports on loopback by default, this is the only entry of the private
# network into the stack: the Supabase API on <DEV host>:54321 and Mailpit behind
# basic auth on <DEV host>:54324. Started by `pnpm dev:gateway` (profile `dev`),
# which exports FAUNOSTEO_DEV_HOST and generates docker/dev-gateway/htpasswd.
dev-gateway:
container_name: faunosteo_dev_gateway
profiles: ["dev"]
image: nginx:1.31-alpine
volumes:
- ./docker/dev-gateway/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./docker/dev-gateway/htpasswd:/etc/nginx/htpasswd:ro
ports:
- "${FAUNOSTEO_DEV_HOST:-127.0.0.1}:54321:54321"
- "${FAUNOSTEO_DEV_HOST:-127.0.0.1}:54324:54324"
security_opt:
- no-new-privileges:true
networks:
- supabase
restart: unless-stopped
networks:
supabase:
external: true
# Local CLI stack: supabase_network_faunosteo; self-hosted compose: its own name.
name: ${SUPABASE_NETWORK:-supabase_network_faunosteo}