-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (73 loc) · 2.41 KB
/
docker-compose.yml
File metadata and controls
75 lines (73 loc) · 2.41 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
services:
pgdb:
image: pgvector/pgvector:pg16
shm_size: 1g
restart: always
healthcheck:
test: 'pg_isready -U user --dbname=postgres'
interval: 1s
timeout: 5s
retries: 10
ports:
- 5533:5432
environment:
POSTGRES_USER: user
POSTGRES_DB: postgres
POSTGRES_PASSWORD: password
command: |
postgres
-c wal_level=logical
-c max_wal_senders=10
-c max_replication_slots=5
-c hot_standby=on
-c max_connections=256
volumes:
- ./.docker/pgdb:/var/lib/postgresql/data
- ./src/database/init.sql:/docker-entrypoint-initdb.d/init.sql
migrate:
image: node:22.4-slim
depends_on:
pgdb:
condition: service_healthy
volumes:
- .:/app
working_dir: /app/src/database
environment:
- RUN=1
- ALLOW_MISSING_ENV=1
- ZERO_UPSTREAM_DB=postgresql://user:password@pgdb:5432/postgres
- ZERO_CVR_DB=postgresql://user:password@pgdb:5432/zero_cvr
- ZERO_CHANGE_DB=postgresql://user:password@pgdb:5432/zero_cdb
command: node migrate-dist.js
zero:
image: "rocicorp/zero:${ZERO_VERSION:-0.25.11}"
depends_on:
- migrate
- pgdb
volumes:
- ./.docker/zero:/app
working_dir: /app
extra_hosts:
# maps host.docker.internal to the host gateway IP on Linux
# on Mac/Windows Docker Desktop, this is already available
- "host.docker.internal:host-gateway"
environment:
- ZERO_ADMIN_PASSWORD=dev-mode
- ZERO_LOG_LEVEL=${ZERO_LOG_LEVEL:-info}
# these URLs are provided via environment variables
# in CI, they'll be overridden with the correct Docker host IP
- ZERO_MUTATE_URL=${ZERO_MUTATE_URL:-http://host.docker.internal:8081/api/zero/push}
- ZERO_QUERY_URL=${ZERO_QUERY_URL:-http://host.docker.internal:8081/api/zero/pull}
- ZERO_MUTATE_FORWARD_COOKIES=true
- ZERO_QUERY_FORWARD_COOKIES=true
- ZERO_UPSTREAM_DB=postgresql://user:password@pgdb:5432/postgres
- ZERO_CVR_DB=postgresql://user:password@pgdb:5432/zero_cvr
- ZERO_CHANGE_DB=postgresql://user:password@pgdb:5432/zero_cdb
# putting this into /app seems to break things
- ZERO_REPLICA_FILE=/tmp/sync-replica.db
# hardcoded worker counts to avoid issues on high-core machines
- ZERO_NUM_SYNC_WORKERS=8
- ZERO_CVR_MAX_CONNS=16
- ZERO_UPSTREAM_MAX_CONNS=32
ports:
- "4948:4848"