A community based topic aggregation platform built on atproto
1version: '3.8'
2
3# Coves Local Development Stack
4# Simple setup: PDS + AppView (no relay needed for local dev)
5# AppView subscribes directly to PDS firehose at ws://localhost:3001/xrpc/com.atproto.sync.subscribeRepos
6# Ports configured to avoid conflicts with production PDS on :3000
7
8services:
9 # Bluesky Personal Data Server (PDS)
10 # Handles user repositories, DIDs, and CAR files
11 pds:
12 image: ghcr.io/bluesky-social/pds:latest
13 container_name: coves-dev-pds
14 ports:
15 - "3001:3000" # PDS XRPC API (avoiding production PDS on :3000)
16 environment:
17 # PDS Configuration
18 PDS_HOSTNAME: ${PDS_HOSTNAME:-localhost}
19 PDS_PORT: 3000
20 PDS_DATA_DIRECTORY: /pds
21 PDS_BLOBSTORE_DISK_LOCATION: /pds/blocks
22 PDS_DID_PLC_URL: ${PDS_DID_PLC_URL:-https://plc.directory}
23 # PDS_CRAWLERS not needed - we're not using a relay for local dev
24
25 # Note: PDS uses its own internal SQLite database and CAR file storage
26 # Our PostgreSQL database is only for the Coves AppView
27
28 # JWT secrets (for local dev only)
29 PDS_JWT_SECRET: ${PDS_JWT_SECRET:-local-dev-jwt-secret-change-in-production}
30 PDS_ADMIN_PASSWORD: ${PDS_ADMIN_PASSWORD:-admin}
31 PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: ${PDS_PLC_ROTATION_KEY:-af514fb84c4356241deed29feb392d1ee359f99c05a7b8f7bff2e5f2614f64b2}
32
33 # Service endpoints
34 PDS_SERVICE_HANDLE_DOMAINS: ${PDS_SERVICE_HANDLE_DOMAINS:-.local.coves.dev}
35
36 # Dev mode settings (allows HTTP instead of HTTPS)
37 PDS_DEV_MODE: "true"
38
39 # Development settings
40 NODE_ENV: development
41 LOG_ENABLED: "true"
42 LOG_LEVEL: ${LOG_LEVEL:-debug}
43 volumes:
44 - pds-data:/pds
45 networks:
46 - coves-dev
47 healthcheck:
48 test: ["CMD", "curl", "-f", "http://localhost:3000/xrpc/_health"]
49 interval: 10s
50 timeout: 5s
51 retries: 5
52
53 # Indigo Relay (BigSky) - OPTIONAL for local dev
54 # WARNING: BigSky is designed to crawl the entire atProto network!
55 # For local dev, consider using direct PDS firehose instead (see AppView config below)
56 #
57 # To use relay: docker-compose -f docker-compose.dev.yml up pds relay
58 # To skip relay: docker-compose -f docker-compose.dev.yml up pds
59 #
60 # If using relay, you MUST manually configure it to only watch local PDS:
61 # 1. Start relay
62 # 2. Use admin API to block all domains except localhost
63 # curl -X POST http://localhost:2471/admin/pds/requestCrawl \
64 # -H "Authorization: Bearer dev-admin-key" \
65 # -d '{"hostname": "localhost:3001"}'
66 relay:
67 image: ghcr.io/bluesky-social/indigo:bigsky-0a2d4173e6e89e49b448f6bb0a6e1ab58d12b385
68 container_name: coves-dev-relay
69 ports:
70 - "2471:2470" # Relay firehose WebSocket (avoiding conflicts)
71 environment:
72 # Relay Configuration
73 BGS_ADMIN_KEY: ${BGS_ADMIN_KEY:-dev-admin-key}
74 BGS_PORT: 2470
75
76 # IMPORTANT: Allow insecure WebSocket for local PDS (ws:// instead of wss://)
77 BGS_CRAWL_INSECURE_WS: "true"
78
79 # Database connection (uses shared PostgreSQL for relay state)
80 DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@host.docker.internal:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable
81
82 # Relay will discover PDSs automatically - use admin API to restrict!
83 # See comments above for how to configure allowlist
84
85 # Development settings
86 LOG_LEVEL: ${LOG_LEVEL:-debug}
87 networks:
88 - coves-dev
89 extra_hosts:
90 - "host.docker.internal:host-gateway"
91 depends_on:
92 pds:
93 condition: service_healthy
94 healthcheck:
95 test: ["CMD", "curl", "-f", "http://localhost:2470/xrpc/_health"]
96 interval: 10s
97 timeout: 5s
98 retries: 5
99 # Mark as optional - start with: docker-compose up pds relay
100 profiles:
101 - relay
102
103 # Coves AppView (Your Go Application)
104 # Subscribes to PDS firehose and indexes Coves-specific data
105 # Note: Uncomment when you have a Dockerfile for the AppView
106 # appview:
107 # build:
108 # context: .
109 # dockerfile: Dockerfile
110 # container_name: coves-dev-appview
111 # ports:
112 # - "8081:8080" # AppView API (avoiding conflicts)
113 # environment:
114 # # Database connection
115 # DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@host.docker.internal:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable
116 #
117 # # PDS Firehose subscription (direct, no relay)
118 # FIREHOSE_URL: ws://pds:3000/xrpc/com.atproto.sync.subscribeRepos
119 #
120 # # PDS connection (for XRPC calls)
121 # PDS_URL: http://pds:3000
122 #
123 # # Application settings
124 # PORT: 8080
125 # ENV: development
126 # LOG_LEVEL: ${LOG_LEVEL:-debug}
127 # networks:
128 # - coves-dev
129 # extra_hosts:
130 # - "host.docker.internal:host-gateway"
131 # depends_on:
132 # - pds
133
134# Note: PostgreSQL runs separately via internal/db/local_dev_db_compose/
135# This stack connects to it via host.docker.internal:5433
136
137networks:
138 coves-dev:
139 driver: bridge
140 name: coves-dev-network
141
142volumes:
143 pds-data:
144 name: coves-dev-pds-data