Skip to content

Commit 7e30b6f

Browse files
committed
Add replicas and fix browser errors
1 parent 4e0817b commit 7e30b6f

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

services/metabase/docker-compose.yml.j2

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ services:
88
- public
99
- monitored
1010
environment:
11-
# Metabase logsd doc: https://www.metabase.com/docs/v0.54/configuring-metabase/log-configuration
12-
- JAVA_OPTS=-Dlog4j.configurationFile=file:/tmp/my_log4j2.xml
11+
# Avoid: site URL basename "/" does not match the actual basename
12+
# https://www.metabase.com/docs/latest/configuring-metabase/environment-variables#mb_site_url
13+
- MB_SITE_URL=https://${ADMIN_DOMAIN}/metabase/
14+
# Metabase logs: https://www.metabase.com/docs/v0.54/configuring-metabase/log-configuration
15+
- JAVA_OPTS=-Dlog4j.configurationFile=file:/etc/metabase/log4j2.xml
1316
# https://www.metabase.com/docs/v0.54/installation-and-operation/configuring-application-database
1417
- MB_DB_TYPE=postgres
1518
- MB_DB_DBNAME=metabase
@@ -19,9 +22,11 @@ services:
1922
- MB_DB_PASS=${METABASE_POSTGRES_PASSWORD}
2023
# https://www.metabase.com/docs/v0.54/installation-and-operation/running-metabase-on-docker#setting-the-java-timezone
2124
- JAVA_TIMEZONE=UTC
25+
# https://www.metabase.com/docs/latest/installation-and-operation/observability-with-prometheus
26+
- MB_PROMETHEUS_SERVER_PORT=9191
2227
deploy:
23-
# we do not need high availability. This service is not critical
24-
replicas: 1
28+
# https://www.metabase.com/learn/metabase-basics/administration/administration-and-operation/metabase-at-scale
29+
replicas: ${METABASE_REPLICAS}
2530
update_config:
2631
parallelism: 1
2732
order: start-first
@@ -31,6 +36,10 @@ services:
3136
constraints:
3237
- node.labels.ops==true
3338
labels:
39+
# prometheus only keeps jobs with `prometheus-job` label
40+
- prometheus-job=metabase
41+
# Set in `MB_PROMETHEUS_SERVER_PORT` environment variable
42+
- prometheus-port=9191
3443
# TODO: add prometheus metrics
3544
- traefik.enable=true
3645
- traefik.docker.network=${PUBLIC_NETWORK}
@@ -61,7 +70,7 @@ services:
6170
retries: 5
6271
configs:
6372
- source: logging_configuration
64-
target: /tmp/my_log4j2.xml
73+
target: /etc/metabase/log4j2.xml
6574

6675
configs:
6776
logging_configuration:

services/metabase/template.env

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
STACK_NAME=${STACK_NAME}
22

3+
METABASE_REPLICAS=${METABASE_REPLICAS}
4+
5+
ADMIN_DOMAIN=${ADMIN_DOMAIN}
6+
37
PUBLIC_NETWORK=${PUBLIC_NETWORK}
48
MONITORED_NETWORK=${MONITORED_NETWORK}
5-
ADMIN_DOMAIN=${ADMIN_DOMAIN}
69

710
POSTGRES_HOST=${POSTGRES_HOST}
811
POSTGRES_PORT=${POSTGRES_PORT}

0 commit comments

Comments
 (0)