forked from martin-sicho/genui-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-main.yml
104 lines (101 loc) · 3.95 KB
/
docker-compose-main.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
version: '3.7'
services:
db:
restart: "always"
image: informaticsmatters/rdkit-cartridge-debian:${POSTGRES_RDKIT_RELEASE:-Release_2021_03_5}
container_name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}db
environment:
- POSTGRES_DB=${POSTGRES_DB:-genui}
- POSTGRES_USER=${POSTGRES_USER:-genui}
- POSTGRES_PASSWORD
volumes:
- ${GENUI_DATA_MOUNT:-./genuidata}/database/:/var/lib/postgresql/data/
networks:
- genui_back
redis:
restart: "always"
image: "redis:alpine"
container_name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}redis
command: redis-server --requirepass ${REDIS_PASSWORD}
networks:
- genui_back
backend:
restart: "always"
image: ${GENUI_DOCKER_IMAGE_PREFIX:-sichom}/genui-main:${GENUI_DOCKER_IMAGE_TAG:-latest}
container_name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}backend
environment:
- GENUI_BACKEND_PROTOCOL=${GENUI_PROTOCOL}
- GENUI_BACKEND_HOST=${GENUI_HOST}
- GENUI_BACKEND_PORT=${GENUI_PORT}
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-genui.settings.prod}
- GENUI_BACKEND_SECRET
- POSTGRES_DB=${POSTGRES_DB:-genui}
- POSTGRES_USER=${POSTGRES_USER:-genui}
- POSTGRES_PASSWORD
- POSTGRES_HOST=${POSTGRES_HOST:-db}
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PASSWORD
- GENUI_FRONTEND_APP_PATH=/app
- PUBLIC_URL=/app
- GENUI_USER=${GENUI_USER:-root}
- GENUI_USER_GROUP=${GENUI_USER_GROUP:-root}
- GENUI_CONTAINER_PREFIX=${GENUI_CONTAINER_PREFIX:-genui-docker-}
entrypoint: /genui/entrypoint-main.sh
volumes:
- ${GENUI_DATA_MOUNT:-./genuidata}/media:/genui/data/files/media/
- ${GENUI_DATA_MOUNT:-./genuidata}/home:/home/${GENUI_USER:-root}
- static:/genui/data/files/static/
- frontend:/genui/frontend
- ${GENUI_SSL_CERTFILE:-./config/nginx/certs/localhost.crt}:/etc/certs/${GENUI_HOST}.crt:ro
- ${GENUI_SSL_KEYFILE:-./config/nginx/certs/localhost.key}:/etc/certs/${GENUI_HOST}.key:ro
- ${DOCKER_USER_CONFIG_MOUNT:-/etc}/group:/etc/group:ro
- ${DOCKER_USER_CONFIG_MOUNT:-/etc}/passwd:/etc/passwd:ro
- ${DOCKER_USER_CONFIG_MOUNT:-/etc}/shadow:/etc/shadow:ro
expose:
- ${GENUI_PORT}
depends_on:
- db
- redis
networks:
- genui_front
- genui_back
frontend:
restart: "always"
image: nginx:latest
container_name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}frontend
environment:
- GENUI_PROTOCOL
- GENUI_HOST
- GENUI_PORT
- GENUI_FRONTEND_APP_PATH=${GENUI_FRONTEND_APP_PATH:-/app}
- BACKEND_DOCKER_HOSTNAME=${GENUI_CONTAINER_PREFIX:-genui-docker-}backend
command: /bin/bash -c "envsubst '$$GENUI_PROTOCOL $$GENUI_HOST $$GENUI_PORT $$GENUI_FRONTEND_APP_PATH $$BACKEND_DOCKER_HOSTNAME' < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/nginx.conf && nginx -g 'daemon off;'"
ports:
- "${GENUI_PORT}:${GENUI_PORT}"
volumes:
- ${GENUI_DATA_MOUNT:-./genuidata}/media:/usr/share/nginx/html/downloads:ro
- static:/usr/share/nginx/html/static:ro
- frontend:/usr/share/nginx/html/app:ro
- ./config/nginx/${GENUI_PROTOCOL}.template:/etc/nginx/conf.d/nginx.conf.template:ro
- ${GENUI_SSL_CERTFILE:-./config/nginx/certs/localhost.crt}:/etc/nginx/conf.d/certs/genui.crt:ro
- ${GENUI_SSL_KEYFILE:-./config/nginx/certs/localhost.key}:/etc/nginx/conf.d/certs/genui.key:ro
depends_on:
- backend
networks:
- genui_front
volumes:
static:
name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}static
frontend:
name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}frontend
networks:
genui_front:
name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}frontend
driver: bridge
driver_opts:
com.docker.network.driver.mtu: ${DOCKER_NET_MTU:-1500}
genui_back:
name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}backend
driver: bridge
driver_opts:
com.docker.network.driver.mtu: ${DOCKER_NET_MTU:-1500}