-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
39 lines (36 loc) · 909 Bytes
/
docker-compose.yaml
File metadata and controls
39 lines (36 loc) · 909 Bytes
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
name: "posts_app"
services:
db:
image: postgres:16
restart: always
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
- POSTGRES_DB=db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
command:
- -c
- listen_addresses=*
- -c
- wal_level=logical
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U user -d db" ]
interval: 5s
timeout: 5s
retries: 5
sync:
image: docker.io/electricsql/electric:latest
environment:
# Use the service name 'db' as the hostname
DATABASE_URL: postgresql://user:password@db:5432/db?sslmode=disable
ELECTRIC_INSECURE: true
ports:
- "3000:3000" # Default ElectricSQL pg-proxy port is 65432, but often mapped differently
depends_on:
db:
condition: service_healthy
volumes:
postgres_data: