Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (42 loc) · 1.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
44 lines (42 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
services:
# Dev database for `alchemy dev` (the dev Hyperdrive origin in
# packages/infra/src/cloudflare/maple-db.ts points here). Port 5499 dodges any host
# Postgres. vitest does NOT need this — tests run embedded PGlite.
postgres:
image: postgres:17-alpine
# wal_level=logical is a runtime GUC (not initdb-time), so flipping it on an
# existing volume needs no reset. Electric tails the WAL via logical
# replication to serve shapes.
command: ["postgres", "-c", "wal_level=logical"]
ports:
- "5499:5432"
environment:
POSTGRES_USER: maple
POSTGRES_PASSWORD: maple
POSTGRES_DB: maple
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U maple -d maple"]
interval: 5s
timeout: 3s
retries: 5
# ElectricSQL sync service — tails Postgres logical replication and serves
# per-table "shapes" over HTTP. The web app never talks to it directly; the
# apps/api shape proxy (/api/sync/shape) authenticates and org-scopes every
# request. ELECTRIC_MANUAL_TABLE_PUBLISHING mirrors prod (PlanetScale can't
# reassign table ownership, so the publication is managed by a Drizzle
# migration rather than by Electric).
electric:
image: electricsql/electric:latest
ports:
- "3473:3000"
environment:
DATABASE_URL: postgresql://maple:maple@postgres:5432/maple?sslmode=disable
ELECTRIC_INSECURE: "true"
ELECTRIC_MANUAL_TABLE_PUBLISHING: "true"
depends_on:
postgres:
condition: service_healthy
volumes:
postgres-data: