A community based topic aggregation platform built on atproto
1version: '3.8'
2
3# Coves Local Development Stack
4# All-in-one setup: PDS + PostgreSQL + optional Relay
5#
6# Usage:
7# make dev-up # Start PDS + PostgreSQL
8# make dev-down # Stop everything
9# docker-compose up relay # Optional: start with relay
10#
11# Profiles:
12# - default: PDS + PostgreSQL (dev database on port 5433)
13# - test: PostgreSQL test database (port 5434)
14# - relay: BigSky relay (optional, will crawl entire network!)
15
16services:
17 # PostgreSQL Database (Port 5433)
18 # Used by Coves AppView for indexing data from firehose
19 postgres:
20 image: postgres:15
21 container_name: coves-dev-postgres
22 ports:
23 - "5433:5432"
24 environment:
25 POSTGRES_DB: ${POSTGRES_DB:-coves_dev}
26 POSTGRES_USER: ${POSTGRES_USER:-dev_user}
27 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-dev_password}
28 volumes:
29 - postgres-data:/var/lib/postgresql/data
30 networks:
31 - coves-dev
32 healthcheck:
33 test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-dev_user} -d ${POSTGRES_DB:-coves_dev}"]
34 interval: 5s
35 timeout: 5s
36 retries: 5
37
38 # PostgreSQL Test Database (Port 5434) - Optional
39 # Use with: docker-compose --profile test up postgres-test
40 postgres-test:
41 image: postgres:15
42 container_name: coves-test-postgres
43 ports:
44 - "5434:5432"
45 environment:
46 POSTGRES_DB: coves_test
47 POSTGRES_USER: test_user
48 POSTGRES_PASSWORD: test_password
49 volumes:
50 - postgres-test-data:/var/lib/postgresql/data
51 networks:
52 - coves-dev
53 healthcheck:
54 test: ["CMD-SHELL", "pg_isready -U test_user -d coves_test"]
55 interval: 5s
56 timeout: 5s
57 retries: 5
58 profiles:
59 - test
60
61 # Bluesky Personal Data Server (PDS)
62 # Handles user repositories, DIDs, and CAR files
63 pds:
64 image: ghcr.io/bluesky-social/pds:latest
65 container_name: coves-dev-pds
66 ports:
67 - "3001:3000" # PDS XRPC API (avoiding production PDS on :3000)
68 environment:
69 # PDS Configuration
70 PDS_HOSTNAME: ${PDS_HOSTNAME:-localhost}
71 PDS_PORT: 3000
72 PDS_DATA_DIRECTORY: /pds
73 PDS_BLOBSTORE_DISK_LOCATION: /pds/blocks
74 PDS_DID_PLC_URL: ${PDS_DID_PLC_URL:-https://plc.directory}
75 # PDS_CRAWLERS not needed - we're not using a relay for local dev
76
77 # Note: PDS uses its own internal SQLite database and CAR file storage
78 # Our PostgreSQL database is only for the Coves AppView
79
80 # JWT secrets (for local dev only)
81 PDS_JWT_SECRET: ${PDS_JWT_SECRET:-local-dev-jwt-secret-change-in-production}
82 PDS_ADMIN_PASSWORD: ${PDS_ADMIN_PASSWORD:-admin}
83 PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: ${PDS_PLC_ROTATION_KEY:-af514fb84c4356241deed29feb392d1ee359f99c05a7b8f7bff2e5f2614f64b2}
84
85 # Service endpoints
86 PDS_SERVICE_HANDLE_DOMAINS: ${PDS_SERVICE_HANDLE_DOMAINS:-.local.coves.dev}
87
88 # Dev mode settings (allows HTTP instead of HTTPS)
89 PDS_DEV_MODE: "true"
90
91 # Development settings
92 NODE_ENV: development
93 LOG_ENABLED: "true"
94 LOG_LEVEL: ${LOG_LEVEL:-debug}
95 volumes:
96 - pds-data:/pds
97 networks:
98 - coves-dev
99 healthcheck:
100 test: ["CMD", "curl", "-f", "http://localhost:3000/xrpc/_health"]
101 interval: 10s
102 timeout: 5s
103 retries: 5
104
105 # Indigo Relay (BigSky) - OPTIONAL for local dev
106 # WARNING: BigSky is designed to crawl the entire atProto network!
107 # For local dev, consider using direct PDS firehose instead (see AppView config below)
108 #
109 # To use relay: docker-compose -f docker-compose.dev.yml up pds relay
110 # To skip relay: docker-compose -f docker-compose.dev.yml up pds
111 #
112 # If using relay, you MUST manually configure it to only watch local PDS:
113 # 1. Start relay
114 # 2. Use admin API to block all domains except localhost
115 # curl -X POST http://localhost:2471/admin/pds/requestCrawl \
116 # -H "Authorization: Bearer dev-admin-key" \
117 # -d '{"hostname": "localhost:3001"}'
118 relay:
119 image: ghcr.io/bluesky-social/indigo:bigsky-0a2d4173e6e89e49b448f6bb0a6e1ab58d12b385
120 container_name: coves-dev-relay
121 ports:
122 - "2471:2470" # Relay firehose WebSocket (avoiding conflicts)
123 environment:
124 # Relay Configuration
125 BGS_ADMIN_KEY: ${BGS_ADMIN_KEY:-dev-admin-key}
126 BGS_PORT: 2470
127
128 # IMPORTANT: Allow insecure WebSocket for local PDS (ws:// instead of wss://)
129 BGS_CRAWL_INSECURE_WS: "true"
130
131 # Database connection (uses PostgreSQL for relay state)
132 DATABASE_URL: postgresql://${POSTGRES_USER:-dev_user}:${POSTGRES_PASSWORD:-dev_password}@postgres:5432/${POSTGRES_DB:-coves_dev}?sslmode=disable
133
134 # Relay will discover PDSs automatically - use admin API to restrict!
135 # See comments above for how to configure allowlist
136
137 # Development settings
138 LOG_LEVEL: ${LOG_LEVEL:-debug}
139 networks:
140 - coves-dev
141 depends_on:
142 postgres:
143 condition: service_healthy
144 pds:
145 condition: service_healthy
146 healthcheck:
147 test: ["CMD", "curl", "-f", "http://localhost:2470/xrpc/_health"]
148 interval: 10s
149 timeout: 5s
150 retries: 5
151 # Mark as optional - start with: docker-compose up pds relay
152 profiles:
153 - relay
154
155 # Coves AppView (Your Go Application)
156 # Subscribes to PDS firehose and indexes Coves-specific data
157 # Note: Uncomment when you have a Dockerfile for the AppView
158 # appview:
159 # build:
160 # context: .
161 # dockerfile: Dockerfile
162 # container_name: coves-dev-appview
163 # ports:
164 # - "8081:8080" # AppView API (avoiding conflicts)
165 # environment:
166 # # Database connection
167 # DATABASE_URL: postgresql://${POSTGRES_USER:-dev_user}:${POSTGRES_PASSWORD:-dev_password}@postgres:5432/${POSTGRES_DB:-coves_dev}?sslmode=disable
168 #
169 # # PDS Firehose subscription (direct, no relay)
170 # FIREHOSE_URL: ws://pds:3000/xrpc/com.atproto.sync.subscribeRepos
171 #
172 # # PDS connection (for XRPC calls)
173 # PDS_URL: http://pds:3000
174 #
175 # # Application settings
176 # PORT: 8080
177 # ENV: development
178 # LOG_LEVEL: ${LOG_LEVEL:-debug}
179 # networks:
180 # - coves-dev
181 # depends_on:
182 # postgres:
183 # condition: service_healthy
184 # pds:
185 # condition: service_healthy
186
187networks:
188 coves-dev:
189 driver: bridge
190 name: coves-dev-network
191
192volumes:
193 postgres-data:
194 name: coves-dev-postgres-data
195 postgres-test-data:
196 name: coves-test-postgres-data
197 pds-data:
198 name: coves-dev-pds-data