Files
Bulwark/docker-compose.yml
Christopher Fahlin ea814c5125 build: add release image, compose backing services, and env scaffolding
- Multi-stage Dockerfile (mix release, embedded ERTS, runs as nobody) with
  migrate/server release overlays for an initContainer migration flow
- docker-compose: standalone-friendly upstream images (postgres:17,
  valkey/valkey:8) for the local dev loop. The cluster's operator images
  (cloudnative-pg, hyperspike) don't run standalone — DSN-from-env already
  gives local<->cluster parity, so image identity is local-only
- .env(.local).example templates + .envrc (direnv) loader
- .dockerignore; .gitignore fixups for release artifacts and env files
2026-05-30 19:07:21 -07:00

52 lines
1.9 KiB
YAML

# Local backing services for the dev loop.
#
# Runs throwaway Postgres + Valkey on your machine; the app runs on the host
# (`mix phx.server`) and connects over localhost. This mirrors the cluster
# topology in miniature — only the DSN differs between local and prod. See the
# developer guide ("Local development") for the rationale.
#
# Images: canonical upstream images pinned to the cluster's MAJOR versions.
# We deliberately do NOT use the cluster's operator images here:
# shared-pg -> cloudnative-pg/postgresql (assumes a k8s-managed PVC; does
# not chown its data dir, so it fails on a plain Docker volume)
# shared-cache -> hyperspike/valkey (ships Cmd=/bin/sh; the Valkey operator
# injects the server command — it never starts standalone)
# DSN-from-env already gives us local↔cluster parity, so the local image
# identity is irrelevant. Use the standalone-friendly upstream images and pin
# the same MAJOR (PG 17, Valkey 8) to avoid behavioral drift.
#
# Env comes from .env.local (gitignored). Copy .env.local.example to start.
services:
postgres:
image: postgres:17
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-bulwark_dev}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 5s
timeout: 3s
retries: 10
valkey:
image: valkey/valkey:8
# No password locally — cluster Valkey REQUIRES one. The DSN (with creds in
# prod) is the only thing that changes; see the auth-parity note in the
# developer guide. Do not hard-code the no-auth form in app code.
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
volumes:
pgdata: