-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
75 lines (69 loc) · 2.05 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
version: '3'
services:
# redis is used by app and celery to exchange background task information
redis:
image: redis:alpine
restart: unless-stopped
environment:
REDIS_APPENDONLY: "yes"
volumes:
- redis:/data
expose:
- 6379
# this service builds the image used by celery and app and exits afterwards
build:
image: app
build: .
# celery executes playbooks in the background
# we need to pass through the ansible project path that contains the playbooks,
# the ssh keys to connect to remote hosts and the proxmox inventory script
celery:
image: app
restart: unless-stopped
environment:
ANSIBLE_PROJECT_PATH: /ansible
CELERY_BROKER_URL: redis://redis
CELERY_RESULT_BACKEND: redis://redis
volumes:
- /home/ansible/clustarr/ansible:/ansible:ro
- /home/ansible/.ssh:/home/abc/.ssh/:ro
- /etc/ansible/proxmox.py:/etc/ansible/proxmox.py:ro
- /etc/ansible/proxmox.json:/etc/ansible/proxmox.json:ro
user: abc
depends_on:
- build
- redis
command: celery worker --app clustarr_backend.celery --loglevel=info
# flower provides a task api for celery
flower:
image: app
restart: unless-stopped
ports:
- 5555:5555
environment:
CELERY_BROKER_URL: redis://redis
CELERY_RESULT_BACKEND: redis://redis
depends_on:
- build
- redis
command: celery flower --app clustarr_backend.celery --persistent --loglevel=info
# flask provides the api and forwards playbook tasks to the celery service
flask:
image: app
restart: unless-stopped
ports:
- 5000:5000
environment:
ANSIBLE_PROJECT_PATH: /ansible
CELERY_BROKER_URL: redis://redis
CELERY_RESULT_BACKEND: redis://redis
volumes:
- /home/ansible/clustarr/ansible:/ansible:ro
- /etc/ansible/proxmox.py:/etc/ansible/proxmox.py:ro
- /etc/ansible/proxmox.json:/etc/ansible/proxmox.json:ro
depends_on:
- build
- celery
command: gunicorn --bind 0.0.0.0:5000 clustarr_backend:app
volumes:
redis: