Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (55 loc) · 1.93 KB
/
Copy pathdocker-compose.yml
File metadata and controls
58 lines (55 loc) · 1.93 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
services:
postgres:
image: postgres:16-alpine
container_name: stellar_alerts_postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespassword
POSTGRES_DB: stellar_alerts
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d stellar_alerts" ]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: stellar_alerts_redis
restart: unless-stopped
ports:
- "6379:6379"
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
interval: 5s
timeout: 5s
retries: 5
# Chaos-engineering fault injection proxy (#145). The API test suite spins
# up its own local fixture server on an ephemeral port and talks to it
# *through* toxiproxy so tests can inject deterministic latency/timeouts/
# disconnects — see apps/api/src/__tests__/chaos.test.ts. Not used at
# runtime by the app itself, only by the chaos test suite (gated on
# TOXIPROXY_URL).
#
# Uses host networking so toxiproxy can reach whatever ephemeral port the
# test process's fixture server bound to on localhost, without needing to
# pre-declare/pass that port into the container. This is Linux-only
# (matches the ubuntu-latest CI runner this is primarily meant for); on
# macOS/Windows Docker Desktop, run toxiproxy directly on the host instead
# (`docker run --network host ghcr.io/shopify/toxiproxy:latest` won't work
# there either — use `-p 8474:8474 -p 8666:8666` and point
# TOXIPROXY_UPSTREAM_HOST at host.docker.internal).
toxiproxy:
image: ghcr.io/shopify/toxiproxy:latest
container_name: stellar_alerts_toxiproxy
restart: unless-stopped
ports:
- "8474:8474"
- "8666:8666"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
postgres_data: