-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.base.yml
189 lines (180 loc) · 5.36 KB
/
docker-compose.base.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
services:
db:
# Docker image docs: https://github.com/bitnami/bitnami-docker-postgresql
# We use PgSQL 11 instead of 12 since that's the newest version of the client
# available in the Python image we're using for the application
image: bitnami/postgresql:11
ports:
- "5432"
env_file: &env_file
- settings.conf
environment:
- "ALLOW_EMPTY_PASSWORD=no"
restart: "unless-stopped"
healthcheck:
test: "pg_isready -U $${POSTGRESQL_USERNAME}"
interval: "10s"
retries: 6
networks:
- life_monitor
volumes:
- "data_db:/bitnami/postgresql"
nginx:
image: bitnami/nginx:1.19-debian-10
depends_on:
- "lm"
ports:
- "8443:8443"
restart: "unless-stopped"
healthcheck:
test: >
/bin/sh -c "http_code=$$(curl --insecure https://lm:8443/health -s -w %{http_code}); if [ $${http_code} -eq 502 ]; then exit 1; fi;"
interval: "2s"
retries: 3
timeout: "1s"
networks:
- life_monitor
volumes:
- "./certs:/nginx/certs:ro"
- "./docker/nginx.conf:/opt/bitnami/nginx/conf/server_blocks/lm.conf:ro"
- "data_static_files:/app/lifemonitor/static:ro"
- "data_specs:/app/specs:ro"
lm:
# Remember that this service is using its default configuration
# to access the database, so the settings must match the environment
# configuration set for db above.
image: crs4/lifemonitor
restart: "unless-stopped"
depends_on:
- "db"
- "init"
- "redis"
user: "${USER_UID}:${USER_GID}"
env_file: *env_file
environment:
- "FLASK_ENV=production"
- "POSTGRESQL_HOST=db"
- "POSTGRESQL_PORT=5432"
- "WEBSOCKET_SERVER=false"
volumes:
- "./certs:/certs:ro"
- "./instance:/lm/instance:ro"
- "./settings.conf:/lm/settings.conf:ro" # default settings
- "data_workflows:/var/data/lm"
- "/tmp/lifemonitor-logs:/var/log/lm"
networks:
- life_monitor
init:
# Remember that this service is using its default configuration
# to access the database, so the settings must match the environment
# configuration set for db above.
image: crs4/lifemonitor
entrypoint: /bin/bash
restart: "no"
command: |
-c "wait-for-postgres.sh && ./lm-admin db init"
depends_on:
- "db"
env_file: *env_file
environment:
- "FLASK_ENV=production"
- "POSTGRESQL_HOST=db"
- "POSTGRESQL_PORT=5432"
volumes:
- "./certs:/certs:ro"
- "./instance:/lm/instance:ro"
- "./settings.conf:/lm/settings.conf:ro" # default settings
- "data_workflows:/var/data/lm"
- type: volume
source: data_static_files
target: /lm/lifemonitor/static
- type: volume
source: data_specs
target: /lm/specs
networks:
- life_monitor
worker:
image: crs4/lifemonitor
entrypoint: /usr/local/bin/worker_entrypoint.sh
restart: "unless-stopped"
depends_on:
- "db"
- "init"
- "redis"
user: "${USER_UID}:${USER_GID}"
env_file: *env_file
environment:
- "FLASK_ENV=production"
- "POSTGRESQL_HOST=db"
- "POSTGRESQL_PORT=5432"
- "WEBSOCKET_SERVER=false"
volumes:
- "./certs:/certs:ro"
- "./instance:/lm/instance:ro"
- "./settings.conf:/lm/settings.conf:ro" # default settings
- "data_workflows:/var/data/lm"
networks:
- life_monitor
ws_server:
image: crs4/lifemonitor
entrypoint: /usr/local/bin/wss-entrypoint.sh
restart: "unless-stopped"
depends_on:
- "db"
- "init"
- "redis"
user: "${USER_UID}:${USER_GID}"
env_file: *env_file
environment:
- "FLASK_ENV=production"
- "WEBSOCKET_SERVER=true"
- "POSTGRESQL_HOST=db"
- "POSTGRESQL_PORT=5432"
- "LIFEMONITOR_TLS_KEY=/certs/lm.key"
- "LIFEMONITOR_TLS_CERT=/certs/lm.crt"
volumes:
- "./certs:/certs:ro"
- "./instance:/lm/instance:ro"
- "./settings.conf:/lm/settings.conf:ro" # default settings
- "data_workflows:/var/data/lm"
ports:
- "8001:8000"
networks:
- life_monitor
redis:
image: bitnami/redis:6.2
ports:
- "6379"
env_file: *env_file
environment:
- "ALLOW_EMPTY_PASSWORD=no"
networks:
- life_monitor
volumes:
- "data_redis:/bitnami/redis/data"
volumes:
data_db:
data_static_files:
data_specs:
data_redis:
data_workflows:
networks:
life_monitor:
# You can easily connect this docker-compose with a
# local instance of the Seek/WorkflowHub docker-compose by putting them
# both on the same Docker network. The configuration below will
# instantiate the life monitor services on a docker network called
# `life_monitor` which is owned and managed by the LifeMonitor docker-compose.
# To connect LifeMonitor to an existing network, set the property `name` below
# to the name of the network name you'd like to connect and set
# the property `external` to `true`, to declare the network as externally managed.
# See the docker-compose network configuration reference for more details.
name: life_monitor
external: false
# If are not using an external network, you can customize
# the network address by uncommenting the lines below
# driver: bridge
# ipam:
# driver: default
# config:
# - subnet: 192.168.238.0/24