solidnerd/docker-bookstack

First quick run using docker compose gives errors.

Closed this issue · 3 comments

Hi,

I tried to just run it based on the readme.

I only changed the APP_URL:

    #set the APP_ to the URL of bookstack without without a trailing slash APP_URL=https://example.com
    - APP_URL=http://localhost:8080

And connecting returns error:

Image

What did I do wrong? what needs to be changed to have a first successful run of bookstack?

  • I don't want HTTPS since it will be handled by a reverse proxy
  • It's only accessible from a VPN. I want to access it from an IP, not necessarily localhost (only to test).
  • it must be running from 8080 or a different port (!=80)

Using the current master (941d10a) and Docker version 27.5.0, build a187fa5

Thanks!

Hm, not sure - I've just stood up an fresh install on my local workstation and had no such issue. The only changes to my docker-compose.yml from the version in Git are like so:

diff --git a/docker-compose.yml b/docker-compose.yml
index 1f6c903..fb07530 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,6 +11,7 @@ services:
     - mysql-data:/var/lib/mysql
 
   bookstack:
+    platform: linux/amd64
     image: solidnerd/bookstack:24.12.1
     depends_on:
     - mysql
@@ -20,7 +21,7 @@ services:
     - DB_USERNAME=bookstack
     - DB_PASSWORD=secret
     #set the APP_ to the URL of bookstack without without a trailing slash APP_URL=https://example.com
-    - APP_URL=http://example.com
+    - APP_URL=http://localhost:8080
     # APP_KEY is used for encryption where needed, so needs to be persisted to
     # preserve decryption abilities.
     # Can run `php artisan key:generate` to generate a key

The addition of platform tags is because I'm running this on an M1 Macbook.

Have you had a dig through the Bookstack debugging documentation? The laravel.log file should be accessible from /var/www/bookstack/storage/logs/ from within the container, as it's not persisted in volumes.

Thanks for the reply.

Here is my diff:

diff --git a/docker-compose.yml b/docker-compose.yml
index 1f6c903..46b3ba6 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -20,11 +20,11 @@ services:
     - DB_USERNAME=bookstack
     - DB_PASSWORD=secret
     #set the APP_ to the URL of bookstack without without a trailing slash APP_URL=https://example.com
-    - APP_URL=http://example.com
+    - APP_URL=http://localhost:8080
     # APP_KEY is used for encryption where needed, so needs to be persisted to
     # preserve decryption abilities.
     # Can run `php artisan key:generate` to generate a key
-    - APP_KEY=SomeRandomStringWith32Characters
+    - APP_KEY=sliXXXXXXXX=
     volumes:
     - uploads:/var/www/bookstack/public/uploads
     - storage-uploads:/var/www/bookstack/storage/uploads

and the log:

www-data@d73c083a08ec:~/bookstack/storage/logs$ cat laravel.log 
[2025-01-19 04:24:37] production.ERROR: Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm. {"exception":"[object] (RuntimeException(code: 0): Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm. at /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:55)
[stacktrace]

It looks like the key I used with linuxserver/docker-bookstack must be in a different format.
All the keys for Laravel are base64, sha512, sha256 but the log says AES...

Can run php artisan key:generate to generate a key is also not really helping.

Problem solved using APP_KEY=base64:sliXXXXXXXX=.
Thanks!