-
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
141 lines (134 loc) · 4.08 KB
/
docker-compose.yaml
File metadata and controls
141 lines (134 loc) · 4.08 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: hazel
services:
# PostgreSQL Database
postgres:
image: postgres:17-alpine
shm_size: 1g
user: postgres
restart: always
healthcheck:
test: "pg_isready -U user --dbname=app"
interval: 10s
timeout: 5s
retries: 5
ports:
- "5432:5432"
environment:
POSTGRES_USER: user
POSTGRES_DB: app
POSTGRES_PASSWORD: password
command: |
postgres
-c max_connections=200
-c wal_level=logical
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init:/docker-entrypoint-initdb.d
# Electric - Real-time sync for Postgres
electric:
image: electricsql/electric:canary
ports:
- "3333:3000"
environment:
DATABASE_URL: "postgresql://user:password@postgres:5432/app?sslmode=disable"
# IMPORTANT: Only use insecure mode in development
# See https://electric-sql.com/docs/guides/security
ELECTRIC_INSECURE: "true"
ELECTRIC_FEATURE_FLAGS: "allow_subqueries,tagged_subqueries"
ELECTRIC_LOG_LEVEL: "debug"
depends_on:
postgres:
condition: service_healthy
restart: always
# Durable Streams - durable event log for bot gateway delivery
durable_streams:
build:
context: .
dockerfile: ./docker/durable-streams/Dockerfile
ports:
- "4437:4437"
environment:
DURABLE_STREAMS_PORT: "4437"
DURABLE_STREAMS_HOST: "0.0.0.0"
DURABLE_STREAMS_DATA_PATH: "/data/streams"
volumes:
- durable_streams_data:/data
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:4437').then(() => process.exit(0)).catch(() => process.exit(1))",
]
interval: 10s
timeout: 5s
retries: 5
restart: always
# Redis for electric-proxy caching
cache_redis:
image: redis:7
ports:
- "6380:6379"
command: ["redis-server", "--maxmemory", "256mb", "--maxmemory-policy", "allkeys-lru"]
volumes:
- cache_redis_data:/data
restart: always
# MinIO - S3-compatible object storage
minio:
image: minio/minio:latest
ports:
- "9000:9000" # S3 API
- "9001:9001" # Console UI
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 5
restart: always
# MinIO bucket initialization
minio-init:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin;
mc mb local/hazel --ignore-existing;
mc anonymous set download local/hazel;
exit 0;
"
# Caddy - Reverse proxy for local development
caddy:
image: caddy:2-alpine
ports:
- "5133:5133" # SSE proxy (electric-proxy)
- "3004:3004" # WebSocket proxy (backend)
volumes:
- ./Caddyfile.docker:/etc/caddy/Caddyfile
- ./certs:/etc/caddy/certs:ro
- caddy_data:/data
- caddy_config:/config
extra_hosts:
- "host.docker.internal:host-gateway"
restart: always
volumes:
postgres_data:
driver: local
cache_redis_data:
driver: local
minio_data:
driver: local
durable_streams_data:
driver: local
caddy_data:
driver: local
caddy_config:
driver: local