-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
197 lines (182 loc) · 4.69 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
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
# for updates and superuser setup, please use:
# docker-compose run python migrate
# docker-compose run
version: "3.4"
services:
mqtt:
image: eclipse-mosquitto
volumes:
- door-commander-mosquitto-log:/mosquitto/log
- door-commander-mosquitto-data:/mosquitto/data
- ./mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
- ./mosquitto/config/mosquitto.acl:/mosquitto/config/mosquitto.acl:ro
- ./mosquitto/config/mosquitto.passwd:/mosquitto/config/mosquitto.passwd
networks:
- web
- mqtt
- inventory_management
ports:
- "127.0.0.1:8082:80" # with nginx SSL reverse proxy
restart: unless-stopped
db:
#image: postgres
build:
context: ./postgres
dockerfile: postgres.dockerfile
args:
POSTGRES_VERSION: 13
#POSTGRES_VERSION: latest
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD
- POSTGRES_DB=db
restart: unless-stopped
volumes:
- door-commander-postgres:/var/lib/postgresql/data
#ports:
# - "127.0.0.1:5432:5432"
networks:
- db
python:
depends_on:
- db
- redis
environment:
&python-environment
OPA_BEARER_TOKEN: '${OPA_BEARER_TOKEN}'
OPA_URL: "http://opa:8181/"
OIDC_RP_CLIENT_ID:
OIDC_RP_CLIENT_SECRET:
OIDC_OP_LOGOUT_URL:
OIDC_OP_USER_ENDPOINT:
OIDC_OP_AUTHORIZATION_ENDPOINT:
OIDC_OP_TOKEN_ENDPOINT:
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD_DJANGO}'
POSTGRES_USER: '${POSTGRES_USER_DJANGO}'
POSTGRES_DB: '${POSTGRES_DB_DJANGO}'
MQTT_PASSWD_CONTROLLER:
MQTT_CONNECTION: '{"host":"mqtt", "port":1883, "keepalive":10}'
DJANGO_LOGGING:
# language=json
'
{
"version": 1,
"disable_existing_loggers": false,
"formatters": { "verbose": { "format": "%(levelname)s %(asctime)s %(name)s %(process)d %(thread)d %(message)s" } },
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "verbose"
}
},
"root": {
"handlers": [
"console"
],
"level": "INFO"
},
"loggers": {
"django": {
"handlers": [
"console"
],
"level": "WARN",
"propagate": false
},
"web_homepage.views": {"level":"WARN"},
"ipware.ip": {"level":"ERROR"}
}
}
'
build:
&python-build
context: ""
dockerfile: Dockerfile
target: python-web
args:
PYTHON_VERSION: 3.8
#image: python_image
volumes:
- "door-commander-python-data:/opt/door-commander.betreiberverein.de/data"
networks:
- db
- opa
- web
- mqtt
ports: []
# - "127.0.0.1:8000:8000"
restart: unless-stopped
celery-beat:
build: *python-build
#image: python_image
command: celery -A door_commander beat -l info -s /opt/door-commander.betreiberverein.de/data/celerybeat-schedule
volumes:
- "celery-beat-schedule:/opt/door-commander.betreiberverein.de/data"
environment: *python-environment
depends_on:
- redis
- db
networks:
- db
- opa
opa:
# TODO =basic
command: run --server --addr :8181 --authentication=token --authorization=basic -c /data/config.yaml /data/policy
environment:
OPA_BEARER_TOKEN: '${OPA_BEARER_TOKEN}'
image: openpolicyagent/opa
networks:
- opa
ports: []
#- "127.0.0.1:8181:8181"
volumes:
- ./opa/:/data/:ro
- opa-persistence:/var/opa/
nginx:
build:
context: ""
dockerfile: Dockerfile
target: nginx
args:
PYTHON_VERSION: 3.8
NGINX_VERSION: 1-alpine
depends_on:
- python
networks:
- web
restart: unless-stopped
redis:
# this redis has no authentication.
# NEVER EXPOSE ITS PORTS
image: redis:alpine
networks:
- db
celery:
command: celery -A door_commander worker -l info
build: *python-build
#image: python_image
volumes: []
environment: *python-environment
depends_on:
- redis
- db
networks:
- db
- mqtt
networks:
mqtt: # mosquitto <--> django
db: # psql <--> django
web: # nginx <--> django
#external:
# name: nginx_door_commander_external
inventory_management:
#external:
# name: nginx_inventory_management_external
opa: #
volumes:
door-commander-python-data:
door-commander-postgres:
door-commander-mosquitto-data:
door-commander-mosquitto-log:
celery-beat-schedule:
opa-persistence: