In dieser Anleitung zeige ich euch, wie ihr BookStack mittels Docker und Traefik bereitstellen könnt. Bei BookStack handelt es sich um eine open source Wiki Software.
Datum
Änderungen
10.11.2022
Erstellung dieser Anleitung
01.06.2023
Anpassung der Traefik Labels
09.12.2024
Anpassung Traefik Anleitung, Anleitung wieder funktionsfähig
Während meines Studiums bin ich auf das Thema "Linux Server" gestoßen.
Viele der Anleitungen im Internet waren jedoch nicht sonderlich hilfreich, da sie veraltet waren.
Dies war die Geburt des Projekts goneuland, welches nun seit 2016 online ist und stetig um neue Anleitungen erweitert wird.
Da es sich um ein Community Projekt handelt, kann jeder ein aktiver Teil von goneuland sein und selbst Anregungen sowie eigene Anleitungen beitragen.
Bitte logge dich ein um einen Kommentar zu verfassen
20 Kommentare
Neueste
ÄltesteAm besten besten Bewertet
Inline Feedbacks
View all comments
sbohner(@sbohner)
2 Monate zuvor
#5402
Hier sind Fehler drin. Lucas’ Fehler habe ich gefunden: Das Volume für MariaDB lautet
– ./sql:/config
muss aber
– ./sql:/var/lib/mysql
lauten.
Trotzdem geht es nicht weiter. bookstack scheint im ./data Verzeichnis in ./data/www die Datei .env anzulegen, jedoch ohne die Datenbankdetails aus den Variablen im docker-compose.yml zu übernehmen. Damit scheitert es hier ein zweites Mal.
Ich habe mir nach einem Anlauf die .env herauskopiert und die Variablen identisch auch hier gesetzt, und folgendes Mapping hizugefügt:
– .env:/config/www/.env
Damit lief es dann durch.
Bookstack ist nun zu erreichen, kommt aber nicht weit:
Edit:
ich habe einen zu langen AppKey erstellt, das mochte bookstack gar nicht.
ich würde die Anleitung nun so schreiben:
1) App-Key erstellen:
openssl rand -base64 24
2) .env Datei erstellen mit dem Inhalt:
# This file, when named as “.env” in the root of your BookStack install
# folder, is used for the core configuration of the application.
# By default this file contains the most common required options but
# a full list of options can be found in the ‘.env.example.complete’ file.
# NOTE: If any of your values contain a space or a hash you will need to
# wrap the entire value in quotes. (eg. MAIL_FROM_NAME=”BookStack Mailer”)
# Application key
# Used for encryption where needed.
# Run php artisan key:generate to generate a valid key.
APP_KEY=<Hier den erstellten App-key>
# Application URL
# This must be the root URL that you want to host BookStack on.
# All URLs in BookStack will be generated using this value
# to ensure URLs generated are consistent and secure.
# If you change this in the future you may need to run a command
# to update stored URLs in the database. Command example:
# php artisan bookstack:update-url https://old.example.comhttps://new.example.com
APP_URL=https://<deine.URL>
Super, funktioniert auf meinem neuen Server (Testserver) einwandfrei. Christian könnte noch auf die E-Mail Einstellungen in der .env eingehen. Sonst sucht, man sich einen Wolf 🙂 Top!
hubort(@hubort)
2 Jahre zuvor
#2440
Danke, Christian!
Werde ich mir die Tage mal anschauen und gucken, wo es bei meiner Instanz hapert.
Edit: Nur um aufzuklären, wo es bei mir hapert: Wenn der Container für die Wartung über Watchtower abgeschaltet wird, wird die gesamte Datenbank gewiped.
Hier sind Fehler drin. Lucas’ Fehler habe ich gefunden: Das Volume für MariaDB lautet
– ./sql:/config
muss aber
– ./sql:/var/lib/mysql
lauten.
Trotzdem geht es nicht weiter. bookstack scheint im ./data Verzeichnis in ./data/www die Datei .env anzulegen, jedoch ohne die Datenbankdetails aus den Variablen im docker-compose.yml zu übernehmen. Damit scheitert es hier ein zweites Mal.
Ich habe mir nach einem Anlauf die .env herauskopiert und die Variablen identisch auch hier gesetzt, und folgendes Mapping hizugefügt:
– .env:/config/www/.env
Damit lief es dann durch.
Bookstack ist nun zu erreichen, kommt aber nicht weit:
Edit:
ich habe einen zu langen AppKey erstellt, das mochte bookstack gar nicht.
ich würde die Anleitung nun so schreiben:
1) App-Key erstellen:
openssl rand -base64 24
2) .env Datei erstellen mit dem Inhalt:
# This file, when named as “.env” in the root of your BookStack install
# folder, is used for the core configuration of the application.
# By default this file contains the most common required options but
# a full list of options can be found in the ‘.env.example.complete’ file.
# NOTE: If any of your values contain a space or a hash you will need to
# wrap the entire value in quotes. (eg. MAIL_FROM_NAME=”BookStack Mailer”)
# Application key
# Used for encryption where needed.
# Run
php artisan key:generate
to generate a valid key.APP_KEY=<Hier den erstellten App-key>
# Application URL
# This must be the root URL that you want to host BookStack on.
# All URLs in BookStack will be generated using this value
# to ensure URLs generated are consistent and secure.
# If you change this in the future you may need to run a command
# to update stored URLs in the database. Command example:
# php artisan bookstack:update-url https://old.example.com https://new.example.com
APP_URL=https://<deine.URL>
# Database details
DB_HOST=bookstack_db
DB_DATABASE=bookstackapp
DB_USERNAME=bookstack
DB_PASSWORD=<DB-Passwort>
# Mail system to use
# Can be ‘smtp’ or ‘sendmail’
MAIL_DRIVER=smtp
# Mail sender details
MAIL_FROM_NAME=”BookStack”
MAIL_FROM=bookstack@example.com
# SMTP mail options
# These settings can be checked using the “Send a Test Email”
# feature found in the “Settings > Maintenance” area of the system.
# For more detailed documentation on mail options, refer to:
# https://www.bookstackapp.com/docs/admin/email-webhooks/#email-configuration
MAIL_HOST=localhost
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
3) korrigiertes docker-compose.yml
version: “3”
services:
bookstack:
image: ghcr.io/linuxserver/bookstack
container_name: bookstack
environment:
– PUID=1000
– PGID=1000
– APP_URL=https://buch.euredomain.de
– DB_HOST=bookstack_db
– DB_USER=bookstack
– DB_PASS=passdb
– DB_DATABASE=bookstackapp
– APP_KEY=<Hier nochmal den App-Key>
volumes:
– ./data:/config
– .env:/config/www/.env
restart: unless-stopped
depends_on:
– bookstack_db
labels:
– “traefik.enable=true”
– “traefik.http.routers.bookstack.entrypoints=websecure”
– “traefik.http.routers.bookstack.rule=Host(
buch.euredomain.de
)”– “traefik.http.routers.bookstack.tls=true”
– “traefik.http.routers.bookstack.tls.certresolver=http_resolver”
– “traefik.http.routers.bookstack.service=bookstack”
– “traefik.http.services.bookstack.loadbalancer.server.port=80”
– “traefik.docker.network=proxy”
– “traefik.http.routers.bookstack.middlewares=default@file”
networks:
– proxy
– default
bookstack_db:
image: ghcr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
– PUID=1000
– PGID=1000
– MYSQL_ROOT_PASSWORD=123456hsdf
– TZ=Europe/Berlin
– MYSQL_DATABASE=bookstackapp
– MYSQL_USER=bookstack
– MYSQL_PASSWORD=passdb
volumes:
– ./sql:/var/lib/mysql
restart: unless-stopped
networks:
– default
networks:
proxy:
external: true
Damit läufts bei mir nun, vllt hilft es hier noch jemanden.
Hallo,
erstmal danke für die einfache Anleitung. Leider bekomme ich die Fehlermeldung bad gateway ausgegeben. Weiß jemand, wie ich dies beheben kann?
Traefik wurde soeben frisch mit der ebenfalls hier befindlichen Anleitung installiert.
VG
Lucas
docker-compose.yml
Super, funktioniert auf meinem neuen Server (Testserver) einwandfrei. Christian könnte noch auf die E-Mail Einstellungen in der .env eingehen. Sonst sucht, man sich einen Wolf 🙂 Top!
Danke, Christian!
Werde ich mir die Tage mal anschauen und gucken, wo es bei meiner Instanz hapert.
Edit: Nur um aufzuklären, wo es bei mir hapert: Wenn der Container für die Wartung über Watchtower abgeschaltet wird, wird die gesamte Datenbank gewiped.