-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
82 lines (77 loc) · 1.86 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
72
73
74
75
76
77
78
79
80
81
82
services:
db:
image: postgres:16
restart: unless-stopped
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 20s
retries: 12
timeout: 20s
rabbitmq:
image: rabbitmq:3-management
restart: unless-stopped
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD-SHELL", "rabbitmq-diagnostics list_queues"]
interval: 20s
retries: 12
timeout: 20s
conductor:
build: .
restart: unless-stopped
command: >
sh -c "
set -xe &&
poetry run python3 manage.py migrate &&
poetry run uvicorn nexgenstack.asgi:application --host 0.0.0.0 --port 8000
"
volumes:
- .:/app
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
environment:
- DJANGO_DB=postgres
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- RABBITMQ_HOST=rabbitmq
- RABBITMQ_PORT=5672
compute:
build: .
restart: unless-stopped
command: >
sh -c "
set -xe &&
export COMPUTE_NODE_NAME="compute-`poetry run python3 get_docker_compose_index.py`" &&
poetry run python3 manage.py compute_node
"
volumes:
- .:/app
depends_on:
rabbitmq:
condition: service_healthy
environment:
- CONDUCTOR_API_URL=http://conductor:8000
- HYPERVISOR_CLIENT_API_KEY=test_hypervisor_client_api_key
- COMPUTE_NODE_TOKEN=test_token
- RABBITMQ_HOST=rabbitmq
- RABBITMQ_PORT=5672
volumes:
pgdata: