forked from jessica-severin/zenbu-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
131 lines (120 loc) · 4.77 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
version: '3.4'
x-zenbu-env: &ZENBU_SRC_DIR /usr/share/zenbu/src
x-zenbu-env: &ZENBU_CONF_DIR /etc/zenbu
x-zenbu-env: &ZENBU_WWW_DIR /usr/share/zenbu/www
x-zenbu-env: &ZENBU_USERS_DIR /var/lib/zenbu/users
x-zenbu-env: &ZENBU_CACHE_DIR /var/lib/zenbu/cache
services:
db:
image: mariadb:10.5.15
secrets:
- db_zenbu_password
environment:
- MARIADB_DATABASE=zenbu_users
- MARIADB_USER=zenbu_admin
- MARIADB_PASSWORD_FILE=/run/secrets/db_zenbu_password
- MARIADB_RANDOM_ROOT_PASSWORD=yes
restart: always
volumes:
- db-datavolume:/var/lib/mysql
- ./db/1-create_database_and_users.sql:/docker-entrypoint-initdb.d/1-create_database_and_users.sql
- ./db/2-create_system_tables.sql:/docker-entrypoint-initdb.d/2-create_system_tables.sql
- ./db/3-create_eedb_tables.sql:/docker-entrypoint-initdb.d/3-create_eedb_tables.sql
www:
image: zenbu_app:${ZENBU_VERSION:-2.11.2}
build:
context: ./app/
target: app
args:
ZENBU_VERSION: ${ZENBU_VERSION:-2.11.2}
ZENBU_SRC_URL: ${ZENBU_SRC_URL:-https://github.com/jessica-severin/ZENBU}
ZENBU_SRC_PATCH: ${ZENBU_SRC_PATCH:-ZENBU_.no.patch}
ZENBU_SRC_DIR: *ZENBU_SRC_DIR
ZENBU_CONF_DIR: *ZENBU_CONF_DIR
ZENBU_CONF_TEMPLATE: app.conf.template
ZENBU_WWW_DIR: *ZENBU_WWW_DIR
ZENBU_WWW_INIT_TEMPLATE: app.init.template
ZENBU_WWW_SITE_TEMPLATE: site.conf.template
ZENBU_USERS_DIR: *ZENBU_USERS_DIR
ZENBU_CACHE_DIR: *ZENBU_CACHE_DIR
ZENBU_AGENT_TEMPLATE: app.agent.template
ENTRYPOINT: docker-entrypoint.sh
secrets:
- smtp_password
- db_zenbu_password
environment:
ZENBU_SRC_DIR: *ZENBU_SRC_DIR
ZENBU_AGENT_BUILDTIME: 583
ZENBU_AGENT_LOADLIMIT: 0.8
ZENBU_AGENT_SLEEPTIME: 10
ZENBU_SRC_DIR: *ZENBU_SRC_DIR
ZENBU_WWW_DIR: *ZENBU_WWW_DIR
ZENBU_USERS_DIR: *ZENBU_USERS_DIR
ZENBU_CACHE_DIR: *ZENBU_CACHE_DIR
ZENBU_SESSID: ${ZENBU_SESSID:-ZENBU_c-BIG_SESSID}
ZENBU_SESSNAME: ${ZENBU_SESSNAME:-c-BIG zenbu}
SMTP_HOST: ${SMTP_HOST:-smtp://smtp.localhost:587}
SMTP_USER: ${SMTP_USER:-admin@localhost}
SMTP_PASSWORD_FILE: /run/secrets/smtp_password
SMTP_FROM: ${EMAIL:-admin@localhost}
ZENBU_CURATOR_EMAIL: ${EMAIL:-admin@localhost}
MYSQL_DATABASE: zenbu_users
MYSQL_USER: zenbu_admin
MYSQL_PASSWORD_FILE: /run/secrets/db_zenbu_password
APACHE_DOCUMENTROOT: *ZENBU_WWW_DIR
APACHE_SERVERADMIN: ${EMAIL:-admin@localhost}
APACHE_SERVERALIAS: ${DOMAIN:-localhost}
APACHE_SERVERNAME: ${DOMAIN:-localhost}
depends_on:
- db
volumes:
- {target: *ZENBU_SRC_DIR, source: src-datavolume, type: volume}
- {target: *ZENBU_CONF_DIR, source: conf-datavolume, type: volume}
- {target: *ZENBU_WWW_DIR, source: www-datavolume, type: volume}
- {target: *ZENBU_USERS_DIR, source: users-datavolume, type: volume}
- {target: *ZENBU_CACHE_DIR, source: cache-datavolume, type: volume}
ports:
- "80:80"
restart: always
entrypoint: "/usr/local/bin/dockerize"
command: [ "-template", "/usr/share/zenbu/src/site.conf.template:/etc/apache2/sites-enabled/zenbu.conf",
"-template", "/usr/share/zenbu/src/app.conf.template:/etc/zenbu/zenbu.conf",
"-template", "/usr/share/zenbu/src/app.init.template:/app.init",
"-template", "/usr/share/zenbu/src/app.agent.template:/app.agent",
"-stdout", "/var/log/apache2/access.log",
"-stderr", "/var/log/apache2/error.log",
"-wait", "tcp://db:3306", "-timeout", "60s",
"/app.init" ]
agent:
image: zenbu_app:${ZENBU_VERSION:-2.11.2}
depends_on:
- db
- www
environment:
ZENBU_SRC_DIR: *ZENBU_SRC_DIR
ZENBU_AGENT_BUILDTIME: 583
ZENBU_AGENT_LOADLIMIT: 0.8
ZENBU_AGENT_SLEEPTIME: 10
volumes:
- {target: *ZENBU_SRC_DIR, source: src-datavolume, type: volume}
- {target: *ZENBU_CONF_DIR, source: conf-datavolume, type: volume}
- {target: *ZENBU_USERS_DIR, source: users-datavolume, type: volume}
- {target: *ZENBU_CACHE_DIR, source: cache-datavolume, type: volume}
restart: always
entrypoint: "/usr/local/bin/dockerize"
command: [ "-template", "/usr/share/zenbu/src/app.agent.template:/app.agent",
"-wait", "tcp://www:80", "-timeout", "60s",
"-wait", "tcp://db:3306", "-timeout", "60s",
"/app.agent" ]
secrets:
db_zenbu_password:
file: ./secrets/db_zenbu_password.txt
smtp_password:
file: ./secrets/smtp_password.txt
volumes:
db-datavolume:
www-datavolume:
conf-datavolume:
src-datavolume:
cache-datavolume:
users-datavolume: