Something went wrong. Try again.
Something went wrong. Try again.
4.1 kB · 106 lines
YAML
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107services: pds: image: ghcr.io/bluesky-social/pds:latest ports: # Host port 2585 to avoid colliding with branchline's PDS on 2584 or # cozy-corner's on 2583. The container-side port matches the host port # because the PDS advertises its public URL from PDS_HOSTNAME:PDS_PORT # (see pds.env) — OAuth / DID resolution has to work the same from # inside and outside the container. - "2585:2585" volumes: - pds-data:/pds env_file: - pds.env environment: # Override pds.env so the PDS resolves and writes did:plc docs against # the local PLC server in this compose network, not the public # plc.directory. Setting it here (not pds.env) makes it impossible to # accidentally point a dev PDS at production. PDS_DID_PLC_URL: http://plc:3000 depends_on: plc: condition: service_healthy restart: unless-stopped
# Local PLC directory so dev never mints did:plc:... entries against the # public registry. Reference impl: https://github.com/did-method-plc/did-method-plc # # Upstream publishes a GHCR image but the package is private, so we build # from the repo at a pinned SHA. First `up` builds (~1–2 min); after that # it's cached locally. Bump the SHA in the build context to update. plc: image: corvus-local/plc:1e301e5e build: context: https://github.com/did-method-plc/did-method-plc.git#1e301e5e29dd419c4dfc7d3100a2a614f9286ebe dockerfile: packages/server/Dockerfile ports: - "2586:3000" environment: # The container's CMD is `node service/index.js` (production entrypoint), # which takes Postgres creds as JSON envs — NOT the `DATABASE_URL` that # the dev-mode `bin.ts` entrypoint takes. Dev doesn't separate migrate # vs runtime users, so the same creds are passed for both. DB_CREDS_JSON: '{"username":"plc","password":"plc","host":"plc-db","port":"5432","database":"plc"}' DB_MIGRATE_CREDS_JSON: '{"username":"plc","password":"plc","host":"plc-db","port":"5432","database":"plc"}' ENABLE_MIGRATIONS: "true" LOG_ENABLED: "true" LOG_LEVEL: info LOG_DESTINATION: "1" depends_on: plc-db: condition: service_healthy healthcheck: # Server's /_health runs a DB ping; readiness here means migrations # finished and the DB is reachable. test: ["CMD", "wget", "-qO-", "http://localhost:3000/_health"] interval: 2s timeout: 2s retries: 30 restart: unless-stopped
plc-db: image: postgres:16-alpine environment: POSTGRES_USER: plc POSTGRES_PASSWORD: plc POSTGRES_DB: plc volumes: - plc-db-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U plc -d plc"] interval: 2s timeout: 2s retries: 30 restart: unless-stopped
# Jetstream stands in for the relay in local dev — the indigo relay uses # a public-IP-only SSRF dialer that refuses to probe a PDS at a private / # loopback address. Jetstream instead subscribes directly to a single PDS # via com.atproto.sync.subscribeRepos and re-emits as a JSON websocket, # which is what each tenant's jetstream consumer subscribes to. # # Jetstream doesn't publish a :latest tag — pin to a SHA tag and refresh # from https://github.com/bluesky-social/jetstream/pkgs/container/jetstream jetstream: image: ghcr.io/bluesky-social/jetstream:sha-ec978dd # Published amd64-only; run under emulation on Apple Silicon. platform: linux/amd64 ports: - "6012:6008" # ws://localhost:6012/subscribe - "6013:6009" # prometheus metrics volumes: - jetstream-data:/data environment: JETSTREAM_DATA_DIR: /data JETSTREAM_WS_URL: ws://pds:2585/xrpc/com.atproto.sync.subscribeRepos # Local PDS is usually quiet; don't bounce the container when idle. JETSTREAM_LIVENESS_TTL: 24h depends_on: - pds restart: unless-stopped
volumes: pds-data: jetstream-data: plc-db-data: