Prepare Matrix for migration and improve service health checks

- Updated .gitignore to selectively track Matrix config files
  - Allow: homeserver.yaml, *.log.config
  - Exclude: *.db*, media_store/, signing keys
- Added Matrix configuration files to repository
- Fixed BookStack environment variables (APP_KEY, DB_* pattern)
- Improved health checks for BookStack, JupyterHub, and Synapse
- All services now have proper health monitoring
This commit is contained in:
Aron Petau 2025-11-06 11:35:28 +01:00
parent 8b0b23a872
commit a52b5e23b1
4 changed files with 112 additions and 26 deletions

10
.gitignore vendored
View file

@ -46,8 +46,13 @@ env/
.continue/ .continue/
# Docker data volumes (NEVER commit these - contain private data!) # Docker data volumes (NEVER commit these - contain private data!)
matrix/data/ # Matrix - allow config files but exclude sensitive data
matrix/data/*.db*
matrix/data/media_store/
matrix/data/.DS_Store
matrix/*.signing.key matrix/*.signing.key
# Matrix config files (homeserver.yaml, *.log.config) are NOT ignored and will be tracked
ollama/ ollama/
open-webui/ open-webui/
data/uploads/ data/uploads/
@ -75,7 +80,8 @@ backups/
# Logs # Logs
*.log *.log
logs/ logs/
*.log.* # Matrix log config is NOT a log file, allow it
!matrix/data/*.log.config
# OS specific # OS specific
.DS_Store .DS_Store

View file

@ -27,8 +27,8 @@ services:
condition: service_started condition: service_started
labels: labels:
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"
- "description=Studio EinsZwoVier PDF Cost Calculator" - "description=studio einszwovier PDF Cost Calculator"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
synapse: synapse:
image: matrixdotorg/synapse:latest image: matrixdotorg/synapse:latest
@ -44,8 +44,7 @@ services:
cpus: 2.0 cpus: 2.0
mem_reservation: 512m mem_reservation: 512m
healthcheck: healthcheck:
test: test: ["CMD-SHELL", "curl -f http://localhost:8008/health || exit 1"]
["CMD-SHELL", "curl -f http://localhost:8008/_matrix/static/ || exit 1"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3
@ -53,7 +52,7 @@ services:
labels: labels:
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"
- "description=Matrix homeserver for print orders" - "description=Matrix homeserver for print orders"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
ollama: ollama:
image: ollama/ollama:latest image: ollama/ollama:latest
@ -75,7 +74,7 @@ services:
labels: labels:
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"
- "description=Local LLM inference engine" - "description=Local LLM inference engine"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
open-webui: open-webui:
image: ghcr.io/open-webui/open-webui:latest image: ghcr.io/open-webui/open-webui:latest
@ -102,16 +101,22 @@ services:
labels: labels:
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"
- "description=Web UI for Ollama LLM" - "description=Web UI for Ollama LLM"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
bookstack: bookstack:
image: lscr.io/linuxserver/bookstack:latest image: lscr.io/linuxserver/bookstack:latest
container_name: bookstack container_name: bookstack
environment: environment:
- MYSQL_ROOT_PASSWORD=${BOOKSTACK_DB_PASSWORD} - PUID=1000
- MYSQL_DATABASE=${BOOKSTACK_DB_DATABASE} - PGID=1000
- MYSQL_USER=${BOOKSTACK_DB_USERNAME} - TZ=Europe/Berlin
- MYSQL_PASSWORD=${BOOKSTACK_DB_PASSWORD} - APP_KEY=${BOOKSTACK_APP_KEY}
- APP_URL=${BOOKSTACK_APP_URL}
- DB_HOST=bookstack-mariadb
- DB_PORT=3306
- DB_DATABASE=${BOOKSTACK_DB_DATABASE}
- DB_USERNAME=${BOOKSTACK_DB_USERNAME}
- DB_PASSWORD=${BOOKSTACK_DB_PASSWORD}
volumes: volumes:
- ./bookstack/bookstack_app_data:/config - ./bookstack/bookstack_app_data:/config
ports: ports:
@ -121,11 +126,7 @@ services:
bookstack-mariadb: bookstack-mariadb:
condition: service_healthy condition: service_healthy
healthcheck: healthcheck:
test: test: ["CMD-SHELL", "curl -f http://localhost:80 || exit 1"]
[
"CMD-SHELL",
"mariadb -u${BOOKSTACK_DB_USERNAME} -p${BOOKSTACK_DB_PASSWORD} -e 'SELECT 1' || exit 1",
]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3
@ -133,7 +134,7 @@ services:
labels: labels:
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"
- "description=BookStack Documentation Wiki" - "description=BookStack Documentation Wiki"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
bookstack-mariadb: bookstack-mariadb:
image: lscr.io/linuxserver/mariadb:latest image: lscr.io/linuxserver/mariadb:latest
@ -164,7 +165,7 @@ services:
labels: labels:
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"
- "description=MariaDB Database for BookStack" - "description=MariaDB Database for BookStack"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
watchtower: watchtower:
image: containrrr/watchtower:latest image: containrrr/watchtower:latest
@ -185,7 +186,7 @@ services:
retries: 3 retries: 3
labels: labels:
- "description=Watchtower Auto-Update Service" - "description=Watchtower Auto-Update Service"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
portainer: portainer:
image: portainer/portainer-ce:latest image: portainer/portainer-ce:latest
@ -209,7 +210,7 @@ services:
start_period: 30s start_period: 30s
labels: labels:
- "description=Portainer Container Management UI" - "description=Portainer Container Management UI"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
jupyterhub: jupyterhub:
build: ./jupyterhub build: ./jupyterhub
@ -231,10 +232,20 @@ services:
cpus: 1.0 cpus: 1.0
depends_on: depends_on:
- web - web
healthcheck:
test:
[
"CMD-SHELL",
"curl -f http://localhost:8001/hub/health || curl -f http://localhost:8001/hub/ || exit 1",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
labels: labels:
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"
- "description=JupyterHub for interactive notebooks" - "description=JupyterHub for interactive notebooks"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
forgejo: forgejo:
image: codeberg.org/forgejo/forgejo:11 image: codeberg.org/forgejo/forgejo:11
@ -262,7 +273,7 @@ services:
labels: labels:
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"
- "description=Forgejo Git Server" - "description=Forgejo Git Server"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"
element-web: element-web:
image: vectorim/element-web:latest image: vectorim/element-web:latest
@ -299,5 +310,5 @@ networks:
default: default:
name: einszwovier_network name: einszwovier_network
labels: labels:
- "description=Studio EinsZwoVier network" - "description=studio einszwovier network"
- "maintainer=Studio EinsZwoVier" - "maintainer=studio einszwovier"

View file

@ -0,0 +1,30 @@
# Configuration file for Synapse.
server_name: "einszwovier.local"
pid_file: /data/homeserver.pid
listeners:
- port: 8008
tls: false
type: http
x_forwarded: true
resources:
- names: [client, federation]
compress: false
database:
name: sqlite3
args:
database: /data/homeserver.db
# Connection and performance settings
max_upload_size: 50M
url_preview_enabled: false
log_config: "/data/localhost.log.config"
media_store_path: /data/media_store
registration_shared_secret: "D2mw3LqNKe98ga-pYO1l5KbXf^jgx&s5yjq&ipAGjln:AzLag8"
report_stats: false
macaroon_secret_key: "T26aaiHWLHbm+P6fi_8:VXTIn0W_kHH__CQAdhPyaLhBe~OG*_"
form_secret: "k,C38Dw^6b8Y+9-cSQpLb@GPoS*1POr8GDWXsLMKLHEU2+&q-@"
signing_key_path: "/data/localhost.signing.key"
trusted_key_servers:
- server_name: "matrix.org"

View file

@ -0,0 +1,39 @@
version: 1
formatters:
precise:
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
handlers:
console:
class: logging.StreamHandler
formatter: precise
loggers:
# This is just here so we can leave `loggers` in the config regardless of whether
# we configure other loggers below (avoid empty yaml dict error).
_placeholder:
level: "INFO"
synapse.storage.SQL:
# beware: increasing this to DEBUG will make synapse log sensitive
# information such as access tokens.
level: INFO
root:
level: INFO
handlers: [console]
disable_existing_loggers: false