-
Notifications
You must be signed in to change notification settings - Fork 1
/
pro.docker-compose.yaml
208 lines (197 loc) · 5.12 KB
/
pro.docker-compose.yaml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
version: "3.9"
services:
posgresql:
image: timescale/timescaledb:2.0.0-pg12
container_name: postgres
restart: "always"
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_DB: ${Postgres_DB}
POSTGRES_USER: ${Postgres_USER}
POSTGRES_PASSWORD: ${Postgres_USER_PW}
redis:
image: redis
container_name: redis
restart: "always"
ports:
- "6379:6379"
volumes:
- redis_data:/data
django:
build:
context: ./ba_framework
dockerfile: ./Dockerfile
command: gunicorn ba_framework.asgi:application --workers 3 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:80
restart: "always"
container_name: django
stdin_open: true
tty: true
volumes:
- './ba_framework:/home/ba_framework'
- staticfiles:/home/ba_framework/static
- certs:/home/ba_framework/certs
depends_on:
- logger
- posgresql
- redis
links:
- posgresql
- redis
env_file:
- .env
environment:
WAIT_HOSTS: posgresql:${Postgres_PORT}
Postgres_DATABASE: ${Postgres_DB}
Postgres_USER: ${Postgres_USER}
Postgres_PASSWORD: ${Postgres_USER_PW}
Postgres_HOST: ${Postgres_HOST}
Postgres_PORT: ${Postgres_PORT}
ADMIN_USERNAME: ${ADMIN_USERNAME}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
ADMIN_EMAIL: ${ADMIN_EMAIL}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY}
DJANGO_DEBUG: "false"
logger:
build:
context: ./ba_framework
dockerfile: ./Dockerfile_logger
restart: "always"
container_name: logger
stdin_open: true
tty: true
volumes:
- "./ba_framework:/home/ba_framework"
- staticfiles:/home/ba_framework/static
depends_on:
- posgresql
- redis
links:
- posgresql
- redis
env_file:
- .env
environment:
WAIT_HOSTS: posgresql:${Postgres_PORT}
Postgres_DATABASE: ${Postgres_DB}
Postgres_USER: ${Postgres_USER}
Postgres_PASSWORD: ${Postgres_USER_PW}
Postgres_HOST: ${Postgres_HOST}
Postgres_PORT: ${Postgres_PORT}
ADMIN_USERNAME: ${ADMIN_USERNAME}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
ADMIN_EMAIL: ${ADMIN_EMAIL}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY}
DJANGO_DEBUG: "true"
celery:
build:
context: ./ba_framework
dockerfile: ./Dockerfile_Celery
command: celery -A ba_framework worker -l info
container_name: celery1
restart: "always"
volumes:
- './ba_framework:/home/ba_framework'
- staticfiles:/home/ba_framework/static
environment:
WAIT_HOSTS: posgresql:${Postgres_PORT}
Postgres_DATABASE: ${Postgres_DB}
Postgres_USER: ${Postgres_USER}
Postgres_PASSWORD: ${Postgres_USER_PW}
Postgres_HOST: ${Postgres_HOST}
Postgres_PORT: ${Postgres_PORT}
ADMIN_USERNAME: ${ADMIN_USERNAME}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
ADMIN_EMAIL: ${ADMIN_EMAIL}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY}
DJANGO_DEBUG: "false"
depends_on:
- redis
celery-beat:
build:
context: ./ba_framework
dockerfile: ./Dockerfile_Celery
command: celery -A ba_framework beat -l info
container_name: celery_beat
restart: "always"
volumes:
- './ba_framework:/home/ba_framework'
- staticfiles:/home/ba_framework/static
environment:
WAIT_HOSTS: posgresql:${Postgres_PORT}
Postgres_DATABASE: ${Postgres_DB}
Postgres_USER: ${Postgres_USER}
Postgres_PASSWORD: ${Postgres_USER_PW}
Postgres_HOST: ${Postgres_HOST}
Postgres_PORT: ${Postgres_PORT}
ADMIN_USERNAME: ${ADMIN_USERNAME}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
ADMIN_EMAIL: ${ADMIN_EMAIL}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY}
DJANGO_DEBUG: "false"
depends_on:
- redis
mqtt_agent:
build: ./mqtt_client
command: python mqtt_client.py
container_name: mqtt_agent
restart: "always"
stdin_open: true
tty: true
volumes:
- './mqtt_client:/home/mqtt_client'
depends_on:
- django
- redis
links:
- django
- redis
nginx:
build:
context: ./nginx
dockerfile: ./Dockerfile
restart: "always"
container_name: nginx
volumes:
- staticfiles:/home/ba_framework/static
- certs:/home/ba_framework/certs
ports:
- 80:80
- 443:443
depends_on:
- django
links:
- django
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin
restart: "always"
depends_on:
- posgresql
ports:
- "8000:80"
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
grafana:
image: grafana/grafana
container_name: grafana
restart: always
depends_on:
- posgresql
links:
- posgresql
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
environment:
GF_SERVER_ROOT_URL: '%(protocol)s://%(domain)s:%(http_port)s/grafana/'
volumes:
postgres_data:
staticfiles:
certs:
grafana_data:
redis_data: