-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yml
71 lines (63 loc) · 1.68 KB
/
docker-compose.yml
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
# Docker-compose configuration to run tests
version: "3"
x-default-django:
&default-django
build:
context: .
args:
TOOSIMPLEQ_DJ_VERSION: ${TOOSIMPLEQ_DJ_VERSION:-4.1}
TOOSIMPLEQ_PY_VERSION: ${TOOSIMPLEQ_PY_VERSION:-3.11}
depends_on:
postgres:
condition: service_healthy
toxiproxy-config:
condition: service_completed_successfully
environment:
TOOSIMPLEQ_TEST_DB: ${TOOSIMPLEQ_TEST_DB:-postgres}
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_HOST_WORKER: postgres-laggy
POSTGRES_PORT_WORKER: 5433
volumes:
- .:/app
services:
django:
<<: *default-django
command: runserver 0.0.0.0:8000
ports:
- 8000:8000
worker:
<<: *default-django
command: worker --queue demo --verbosity 3
postgres:
image: postgres
environment:
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD", "bash", "-c", "pg_isready -U postgres"]
interval: 5s
retries: 6
start_period: 1s
ports:
- 5432:5432
postgres-laggy:
image: ghcr.io/shopify/toxiproxy
depends_on:
postgres:
condition: service_healthy
environment:
POSTGRES_PASSWORD: postgres
ports:
- 5433:5433
toxiproxy-config:
image: docker:cli
depends_on:
postgres-laggy:
condition: service_started
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: |
sh -c '
docker exec django-toosimple-q-postgres-laggy-1 /toxiproxy-cli create -l 0.0.0.0:5433 -u postgres:5432 postgres
docker exec django-toosimple-q-postgres-laggy-1 /toxiproxy-cli toxic add -t latency -n my_lag -a latency=100 -a jitter=5 postgres
'