Inconsistent behaviour when APP_URL is passed from docker environment variables #5390

Open
opened 2026-02-05 10:01:46 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @unknowndomain on GitHub (Aug 5, 2025).

Describe the Bug

When using the Linux Server Docker container it's recommended to set the APP_URL in the environment variables of your docker-compose.yml file.

However although the APP_URL works in some places, it doesn't work with Slack as a third party auth.

In order to make it work you need an APP_URL, which clearly is only respected by the Slack authentication login if it comes from the .env file.

Steps to Reproduce

  1. Create a docker container using a Slack authentication purely using the .env file.
  2. Swap the APP_URL from the .env file to the docker-compose.yml file making sure to remove it from .env.
  3. Reload the login page when logged out and notice the button for Slack will vanish.

Expected Behaviour

Bookstack should probably respect all environment variables passed in from the shell, over and above the .env file to the extent you could skip having one entirely.

Screenshots or Additional Context

I discovered this while migrating a site from a VM directly installed, to a Docker container using a Docker Compose file I'm writing.

services:
  mariadb:
    container_name: mariadb
    image: lscr.io/linuxserver/mariadb:latest
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - MYSQL_ROOT_PASSWORD=password
    ports:
      - 127.0.0.1:3306:3306
    volumes:
      - ./mariadb:/config
    restart: unless-stopped
    networks:
      - mariadb

  bookstack:
    container_name: bookstack
    image: lscr.io/linuxserver/bookstack:latest
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      # - APP_URL=http://bookstack.example.com
      # - APP_KEY=secret
      - DB_HOST=mariadb
      - DB_PORT=3306
      - DB_USERNAME=username
      - DB_PASSWORD=password
      - DB_DATABASE=db
    volumes:
      - ./path:/config
    ports:
      - 80:80
      - 443:443
    depends_on:
      - mariadb
    restart: unless-stopped
    networks:
      - mariadb

networks:
  mariadb:
  bookstack:
  

Browser Details

Firefox macOS ARM64 141.0

Exact BookStack Version

25.07

Originally created by @unknowndomain on GitHub (Aug 5, 2025). ### Describe the Bug When using the Linux Server Docker container it's recommended to set the `APP_URL` in the environment variables of your `docker-compose.yml` file. However although the `APP_URL` works in some places, it doesn't work with Slack as a third party auth. In order to make it work you need an `APP_URL`, which clearly is only respected by the Slack authentication login if it comes from the `.env` file. ### Steps to Reproduce 1. Create a docker container using a Slack authentication purely using the `.env` file. 2. Swap the `APP_URL` from the `.env` file to the `docker-compose.yml` file making sure to remove it from `.env`. 3. Reload the login page when logged out and notice the button for Slack will vanish. ### Expected Behaviour Bookstack should probably respect all environment variables passed in from the shell, over and above the `.env` file to the extent you could skip having one entirely. ### Screenshots or Additional Context I discovered this while migrating a site from a VM directly installed, to a Docker container using a Docker Compose file I'm writing. ``` services: mariadb: container_name: mariadb image: lscr.io/linuxserver/mariadb:latest environment: - PUID=1000 - PGID=1000 - TZ=Europe/London - MYSQL_ROOT_PASSWORD=password ports: - 127.0.0.1:3306:3306 volumes: - ./mariadb:/config restart: unless-stopped networks: - mariadb bookstack: container_name: bookstack image: lscr.io/linuxserver/bookstack:latest environment: - PUID=1000 - PGID=1000 - TZ=Europe/London # - APP_URL=http://bookstack.example.com # - APP_KEY=secret - DB_HOST=mariadb - DB_PORT=3306 - DB_USERNAME=username - DB_PASSWORD=password - DB_DATABASE=db volumes: - ./path:/config ports: - 80:80 - 443:443 depends_on: - mariadb restart: unless-stopped networks: - mariadb networks: mariadb: bookstack: ``` ### Browser Details Firefox macOS ARM64 141.0 ### Exact BookStack Version 25.07
OVERLORD added the 🐛 Bug label 2026-02-05 10:01:46 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Aug 5, 2025):

Hi @unknowndomain, env options should already take precedence over the .env file.
Are you re-creating (re-upping) the container after making changes? or just restarting the container? Or not even that?

The two will differ in regards to how changes will enact.
.env changes will take effect right away.
Docker env options need the container to be created with the env options, so changes made would require the container to be rebuilt (not just restarted).

@ssddanbrown commented on GitHub (Aug 5, 2025): Hi @unknowndomain, env options should already take precedence over the `.env` file. Are you re-creating (re-upping) the container after making changes? or just restarting the container? Or not even that? The two will differ in regards to how changes will enact. `.env` changes will take effect right away. Docker env options need the container to be created with the env options, so changes made would require the container to be rebuilt (not just restarted).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5390