-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
115 lines (105 loc) · 2.72 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
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
version: '3'
services:
# Nginx Service
nginx:
image: 'nginx:1.15'
ports:
- '80:80'
volumes:
- '.:/code'
- './docker/nginx:/etc/nginx/conf.d'
depends_on:
- web
restart: always
healthcheck:
test: '/bin/bash service nginx status || exit 1'
interval: 3s
timeout: 1s
retries: 5
# MYSQL Service (DB)
db:
image: 'mysql:5.6'
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=homestead
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
restart: always
healthcheck:
test: '/usr/bin/mysql --user=homestead --password=secret --execute "SHOW DATABASES;"'
interval: 3s
timeout: 1s
retries: 5
# Web UI Service
web:
image: "clivern_kraven:1.0.0"
build: .
command: 'gunicorn --bind 0.0.0.0:8000 app.wsgi'
volumes:
- '.:/code'
depends_on:
- db
- redis
- rabbitmq
restart: always
healthcheck:
test: 'python3 manage.py health check'
interval: 3s
timeout: 1s
retries: 5
# Worker Service
worker1:
image: "clivern_kraven:1.0.0"
build: .
command: 'celery -A app worker --loglevel=info -n worker1'
volumes:
- '.:/code'
depends_on:
- db
- redis
- rabbitmq
restart: always
healthcheck:
test: 'python3 manage.py health check'
interval: 3s
timeout: 1s
retries: 5
# Redis Service
redis:
image: 'redis:3.2-alpine'
volumes:
- 'redis_data:/data'
restart: always
# RabbitMQ Service
rabbitmq:
image: 'rabbitmq:3-management'
hostname: rabbit
ports:
- '15672:15672'
labels:
NAME: rabbitmq
volumes:
- './docker/rabbitmq/rabbitmq-isolated.conf:/etc/rabbitmq/rabbitmq.config'
restart: always
# Prometheus Service
prometheus:
image: 'prom/prometheus:v2.3.2'
volumes:
- './docker/prometheus:/etc/prometheus'
command: '--config.file=/etc/prometheus/prometheus.yml'
ports:
- '9090:9090'
depends_on:
- nginx
restart: always
# Grafana Service
grafana:
image: 'grafana/grafana:5.2.2'
ports:
- '3000:3000'
depends_on:
- prometheus
restart: always
volumes:
redis_data: null