-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (89 loc) · 3 KB
/
Copy pathdocker-compose.yml
File metadata and controls
92 lines (89 loc) · 3 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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
-c log_error_verbosity=terse
-c log_min_messages=fatal
-c idle_in_transaction_session_timeout=300000
-c statement_timeout=60000
-c tcp_keepalives_idle=60
-c tcp_keepalives_interval=10
-c tcp_keepalives_count=3
# for verbose logging when debugging (uncomment as needed):
# -c log_error_verbosity=default
# -c log_min_messages=info
# -c log_statement=all
# -c log_connections=on
# -c log_disconnections=on
# -c log_duration=on
# -c log_line_prefix='%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
volumes:
- pgdb_data:/var/lib/postgresql/data
- ./src/database/:/docker-entrypoint-initdb.d
migrate:
image: node:24-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:-error-run-bun-tko-run-env-update}"
depends_on:
migrate:
condition: service_completed_successfully
pgdb:
condition: service_healthy
volumes:
- zero_data:/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_LOG_LEVEL: ${ZERO_LOG_LEVEL:-warn}
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
ZERO_MUTATE_URL: http://host.docker.internal:${VITE_PORT_WEB:-8081}/api/zero/push
ZERO_QUERY_URL: http://host.docker.internal:${VITE_PORT_WEB:-8081}/api/zero/pull
ZERO_ADMIN_PASSWORD: 'dev'
ZERO_APP_PUBLICATIONS: ${ZERO_APP_PUBLICATIONS:-zero_takeout}
ZERO_CVR_MAX_CONNS: ${ZERO_CVR_MAX_CONNS:-4}
ZERO_MUTATE_FORWARD_COOKIES: ${ZERO_MUTATE_FORWARD_COOKIES:-true}
ZERO_QUERY_FORWARD_COOKIES: ${ZERO_QUERY_FORWARD_COOKIES:-true}
ZERO_NUM_SYNC_WORKERS: ${ZERO_NUM_SYNC_WORKERS:-4}
ZERO_UPSTREAM_MAX_CONNS: ${ZERO_UPSTREAM_MAX_CONNS:-10}
ports:
- "${VITE_PORT_ZERO:-4948}:4848"
volumes:
pgdb_data:
zero_data: