~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/pds.js

An atproto PDS in JavaScript, for Cloudflare Workers and Node

0
0
main
112 lines · 3.0 KB Raw History
services:
  plc:
    build:
      context: https://github.com/did-method-plc/did-method-plc.git
      dockerfile: packages/server/Dockerfile
    ports:
      - "2582:2582"
    environment:
      - DATABASE_URL=postgres://plc:plc@postgres:5432/plc
      - PORT=2582
    command: ["dumb-init", "node", "--enable-source-maps", "../dist/bin.js"]
    depends_on:
      postgres:
        condition: service_healthy
    healthcheck:
      test: ["CMD-SHELL", "wget -q --spider http://localhost:2582/_health || exit 1"]
      interval: 2s
      timeout: 5s
      retries: 15

  relay:
    image: ghcr.io/bluesky-social/indigo:bigsky-6fcd9317e725af1b3077f386a42b22eadcdc7d7f
    platform: linux/amd64
    ports:
      - "2470:2470"
    environment:
      - GOLOG_LOG_LEVEL=info
      - DATA_DIR=/data
      - RELAY_ADMIN_KEY=localdev
      - ATP_PLC_HOST=http://plc:2582
      # Trust Caddy's internal CA for local HTTPS
      - SSL_CERT_FILE=/caddy-ca/caddy/pki/authorities/local/root.crt
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - relay_data:/data
      - caddy_data:/caddy-ca:ro
    command: ["/bin/sh", "-c", "cat /caddy-ca/caddy/pki/authorities/local/root.crt >> /etc/ssl/certs/ca-certificates.crt && /bigsky --api-listen :2470"]
    depends_on:
      plc:
        condition: service_healthy
      caddy:
        condition: service_healthy
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:2470/xrpc/_health || exit 1"]
      interval: 2s
      timeout: 5s
      retries: 15

  # Caddy reverse proxy - provides HTTPS for the PDS so relay can verify it
  caddy:
    image: caddy:2-alpine
    ports:
      - "3443:3443"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - ./docker/Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy_data:/data
    healthcheck:
      test: ["CMD-SHELL", "nc -z localhost 3443 || exit 1"]
      interval: 2s
      timeout: 5s
      retries: 15
      start_period: 5s

  postgres:
    image: postgres:16-alpine
    environment:
      - POSTGRES_USER=plc
      - POSTGRES_PASSWORD=plc
      - POSTGRES_DB=plc
    volumes:
      - plc_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U plc"]
      interval: 2s
      timeout: 5s
      retries: 10

  # Catch-all mail inbox for local development. The PDS (run on the host) sends
  # to SMTP on 1025; read what it sent in the web UI at http://localhost:8025.
  mailpit:
    image: axllent/mailpit:latest
    ports:
      - "1025:1025"
      - "8025:8025"
    environment:
      - MP_MAX_MESSAGES=500

  minio:
    image: minio/minio:latest
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      - MINIO_ROOT_USER=minioadmin
      - MINIO_ROOT_PASSWORD=minioadmin
    command: server /data --console-address ":9001"
    volumes:
      - minio_data:/data
    healthcheck:
      test: ["CMD", "mc", "ready", "local"]
      interval: 2s
      timeout: 5s
      retries: 10

volumes:
  plc_data:
  relay_data:
  caddy_data:
  minio_data: