-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
101 lines (97 loc) · 2.51 KB
/
docker-compose.yaml
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
93
94
95
96
97
98
99
100
101
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: electric
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- "5555:5432"
volumes:
- ./postgres/postgres.conf:/etc/postgresql.conf:ro
- ./postgres/init.sql:/docker-entrypoint-initdb.d/00_shared_init.sql:ro
tmpfs:
- /var/lib/postgresql/data
- /tmp
entrypoint:
- docker-entrypoint.sh
- -c
- config_file=/etc/postgresql.conf
# https://stackoverflow.com/a/67059603
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
electric:
image: electricsql/electric:0.9.3
environment:
DATABASE_URL: "postgresql://postgres:password@postgres:5432/electric?sslmode=disable"
LOG_LEVEL: "info"
# LOG_LEVEL: "debug"
ELECTRIC_STORAGE_DIR: "/var/db/electric"
ELECTRIC_STATSD_HOST: "metric-writer"
ELECTRIC_TELEMETRY_URL: "http://metric-writer:8125"
tmpfs:
- /var/db/electric
- /tmp
ports:
- "3333:3000"
depends_on:
postgres:
condition: service_healthy
metric-writer:
condition: service_started
metric-writer:
image: electricsql/metric-writer:latest
environment:
DATABASE_URL: "postgresql://postgres:password@postgres:5432/electric?sslmode=disable"
LOG_LEVEL: "info"
# LOG_LEVEL: "debug"
TRY_MIGRATION: "true"
depends_on:
postgres:
condition: service_healthy
varnish:
build:
context: ./varnish
args:
BACKEND_HOST: "electric"
BACKEND_PORT: "3000"
ports:
- 8888:8888
command: ["-a", ":8888"]
tmpfs:
- /var/lib/varnish/varnishd:exec
- /tmp
depends_on:
- electric
ulimits:
nofile:
soft: 10000000
hard: 10000000
memlock:
soft: -1
hard: -1
sysctls:
"net.ipv4.tcp_tw_reuse": "1"
"net.ipv4.tcp_timestamps": "1"
"net.ipv4.tcp_rmem": "1024 4096 16384"
"net.ipv4.tcp_wmem": "1024 4096 16384"
clients:
build:
context: ./client_load
environment:
DATABASE_URL: "postgresql://postgres:password@postgres:5432/electric?sslmode=disable"
ELECTRIC_URL: "http://varnish:8888"
CLIENT_COUNT: "${clients:-1000}"
CLIENT_WAIT: "5"
ulimits:
nofile:
soft: 10000000
hard: 10000000
depends_on:
postgres:
condition: service_healthy
varnish:
condition: service_started