Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify init, prefer envs, make fewer assumptions #231

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG BUILD_DATE
ARG VERSION
ARG BOOKSTACK_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="homerr"
LABEL maintainer="thespad"

ENV S6_STAGE2_HOOK="/init-hook"

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG BUILD_DATE
ARG VERSION
ARG BOOKSTACK_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="homerr"
LABEL maintainer="thespad"

ENV S6_STAGE2_HOOK="/init-hook"

Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ pipeline {
PR_DOCKERHUB_IMAGE = 'lspipepr/bookstack'
DIST_IMAGE = 'alpine'
MULTIARCH = 'true'
CI = 'true'
CI = 'false'
CI_WEB = 'false'
CI_PORT = '80'
CI_SSL = 'false'
CI_DELAY = '60'
CI_DOCKERENV='TEST_RUN=1'
CI_DOCKERENV=''
CI_AUTH = ''
CI_WEBPATH = ''
}
Expand Down
69 changes: 27 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Find us at:
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/bookstack.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/bookstack)
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/bookstack.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/bookstack)
[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-bookstack%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-bookstack/job/master/)
[![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2Fbookstack%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/bookstack/latest/index.html)

[Bookstack](https://github.com/BookStackApp/BookStack) is a free and open source Wiki designed for creating beautiful documentation. Featuring a simple, but powerful WYSIWYG editor it allows for teams to create detailed and useful documentation with ease.

Expand All @@ -63,30 +62,31 @@ The architectures supported by this image are:

## Application Setup

The default username is admin@admin.com with the password of **password**, access the container at http://dockerhost:6875.
The default username is admin@admin.com with the password of **password**, access the container at http://<host ip>:6875.

This application is dependent on a MySQL database be it one you already have or a new one. If you do not already have one, set up our MariaDB container here https://hub.docker.com/r/linuxserver/mariadb/.


If you intend to use this application behind a subfolder reverse proxy, such as our SWAG container or Traefik you will need to make sure that the `APP_URL` environment variable is set to your external domain, or it will not work.

Documentation for BookStack can be found at https://www.bookstackapp.com/docs/.

### BookStack File & Directory Paths

This container ensures certain BookStack application files & folders, such as user file upload folders, are retained within the `/config` folder so that they are persistent & accessible when the `/config` container path is bound as a volume. There may be cases, when following the BookStack documentation, that you'll need to know how these files and folders are used relative to a non-container BookStack installation.

Below is a mapping of container `/config` paths to those relative within a BookStack install directory:

- **/config container path** => **BookStack relative path**
- `/config/www/.env` => `.env`
- `/config/www/laravel.log` => `storage/logs/laravel.log`
- `/config/www/backups/` => `storage/backups/`
- `/config/log/bookstack/laravel.log` => `storage/logs/laravel.log`
- `/config/backups/` => `storage/backups/`
- `/config/www/files/` => `storage/uploads/files/`
- `/config/www/images/` => `storage/uploads/images/`
- `/config/www/themes/` => `themes/`
- `/config/www/uploads/` => `public/uploads/`

### Advanced Users (full control over the .env file)

If you wish to use the extra functionality of BookStack such as email, Memcache, LDAP and so on you will need to make your own .env file with guidance from the BookStack documentation.

When you create the container, do not set any arguments for any SQL settings. The container will copy an exemplary .env file to /config/www/.env on your host system for you to edit.
Expand All @@ -101,40 +101,24 @@ To help you get started creating a container from this image you can either use
---
services:
bookstack:
image: lscr.io/linuxserver/bookstack
image: lscr.io/linuxserver/bookstack:latest
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- APP_URL=https://bookstack.example.com
- DB_HOST=bookstack_db
- TZ=Etc/UTC
- APP_URL=
- DB_HOST=
- DB_PORT=3306
- DB_USER=bookstack
- DB_PASS=<yourdbpass>
- DB_DATABASE=bookstackapp
- DB_USERNAME=
- DB_PASSWORD=
- DB_DATABASE=
- QUEUE_CONNECTION= #optional
volumes:
- /path/to/bookstack_app_data:/config
- /path/to/bookstack/config:/config
ports:
- 6875:80
restart: unless-stopped
depends_on:
- bookstack_db

bookstack_db:
image: lscr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- MYSQL_ROOT_PASSWORD=<yourdbpass>
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=<yourdbpass>
volumes:
- /path/to/bookstack_db_data:/config
restart: unless-stopped
```

### docker cli ([click here for more info](https://docs.docker.com/engine/reference/commandline/cli/))
Expand All @@ -145,12 +129,12 @@ docker run -d \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e APP_URL=yourbaseurl \
-e DB_HOST=yourdbhost \
-e DB_PORT=yourdbport \
-e DB_USER=yourdbuser \
-e DB_PASS=yourdbpass \
-e DB_DATABASE=bookstackapp \
-e APP_URL= \
-e DB_HOST= \
-e DB_PORT=3306 \
-e DB_USERNAME= \
-e DB_PASSWORD= \
-e DB_DATABASE= \
-e QUEUE_CONNECTION= `#optional` \
-p 6875:80 \
-v /path/to/bookstack/config:/config \
Expand All @@ -168,12 +152,12 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e PUID=1000` | for UserID - see below for explanation |
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-e APP_URL=yourbaseurl` | for specifying the IP:port or URL your application will be accessed on (ie. `http://192.168.1.1:6875` or `https://bookstack.mydomain.com` |
| `-e DB_HOST=yourdbhost` | for specifying the database host |
| `-e DB_PORT=yourdbport` | for specifying the database port if not default 3306 |
| `-e DB_USER=yourdbuser` | for specifying the database user |
| `-e DB_PASS=yourdbpass` | for specifying the database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.) |
| `-e DB_DATABASE=bookstackapp` | for specifying the database to be used |
| `-e APP_URL=` | The IP:port or URL your application will be accessed on (ie. `http://192.168.1.1:6875` or `https://bookstack.mydomain.com` |
| `-e DB_HOST=` | The database instance hostname |
| `-e DB_PORT=3306` | Database port (default `3306`) |
| `-e DB_USERNAME=` | Database user |
| `-e DB_PASSWORD=` | Database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.) |
| `-e DB_DATABASE=` | Database name |
| `-e QUEUE_CONNECTION=` | Set to `database` to enable async actions like sending email or triggering webhooks. See [documentation](https://www.bookstackapp.com/docs/admin/email-webhooks/#async-action-handling). |
| `-v /config` | Persistent config files |

Expand Down Expand Up @@ -339,6 +323,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **11.10.24:** - Default to environment config over .env file config.
* **06.09.24:** - Add php-exif for reading image EXIF data.
* **27.05.24:** - Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings.
* **25.01.24:** - Existing users should update: site-confs/default.conf - Cleanup default site conf.
Expand Down
4 changes: 2 additions & 2 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ repo_vars:
- PR_DOCKERHUB_IMAGE = 'lspipepr/bookstack'
- DIST_IMAGE = 'alpine'
- MULTIARCH = 'true'
- CI = 'true'
- CI = 'false'
- CI_WEB = 'false'
- CI_PORT = '80'
- CI_SSL = 'false'
- CI_DELAY = '60'
- CI_DOCKERENV='TEST_RUN=1'
- CI_DOCKERENV=''
- CI_AUTH = ''
- CI_WEBPATH = ''
62 changes: 12 additions & 50 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ param_volumes:
- { vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/config", desc: "Persistent config files" }
param_usage_include_env: true
param_env_vars:
- { env_var: "APP_URL", env_value: "yourbaseurl", desc: "for specifying the IP:port or URL your application will be accessed on (ie. `http://192.168.1.1:6875` or `https://bookstack.mydomain.com`"}
- { env_var: "DB_HOST", env_value: "yourdbhost", desc: "for specifying the database host" }
- { env_var: "DB_PORT", env_value: "yourdbport", desc: "for specifying the database port if not default 3306" }
- { env_var: "DB_USER", env_value: "yourdbuser", desc: "for specifying the database user" }
- { env_var: "DB_PASS", env_value: "yourdbpass", desc: "for specifying the database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.)" }
- { env_var: "DB_DATABASE", env_value: "bookstackapp", desc: "for specifying the database to be used" }
- { env_var: "APP_URL", env_value: "", desc: "The IP:port or URL your application will be accessed on (ie. `http://192.168.1.1:6875` or `https://bookstack.mydomain.com`"}
- { env_var: "DB_HOST", env_value: "", desc: "The database instance hostname" }
- { env_var: "DB_PORT", env_value: "3306", desc: "Database port (default `3306`)" }
- { env_var: "DB_USERNAME", env_value: "", desc: "Database user" }
- { env_var: "DB_PASSWORD", env_value: "", desc: "Database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.)" }
- { env_var: "DB_DATABASE", env_value: "", desc: "Database name" }

param_usage_include_ports: true
param_ports:
Expand All @@ -39,80 +39,42 @@ opt_param_usage_include_env: true
opt_param_env_vars:
- { env_var: "QUEUE_CONNECTION", env_value: "", desc: "Set to `database` to enable async actions like sending email or triggering webhooks. See [documentation](https://www.bookstackapp.com/docs/admin/email-webhooks/#async-action-handling)." }

custom_compose: |
---
services:
bookstack:
image: lscr.io/linuxserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- APP_URL=https://bookstack.example.com
- DB_HOST=bookstack_db
- DB_PORT=3306
- DB_USER=bookstack
- DB_PASS=<yourdbpass>
- DB_DATABASE=bookstackapp
volumes:
- /path/to/bookstack_app_data:/config
ports:
- 6875:80
restart: unless-stopped
depends_on:
- bookstack_db

bookstack_db:
image: lscr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- MYSQL_ROOT_PASSWORD=<yourdbpass>
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=<yourdbpass>
volumes:
- /path/to/bookstack_db_data:/config
restart: unless-stopped

# application setup block
app_setup_block_enabled: true
app_setup_block: |

The default username is admin@admin.com with the password of **password**, access the container at http://dockerhost:6875.
The default username is admin@admin.com with the password of **password**, access the container at http://<host ip>:6875.

This application is dependent on a MySQL database be it one you already have or a new one. If you do not already have one, set up our MariaDB container here https://hub.docker.com/r/linuxserver/mariadb/.


If you intend to use this application behind a subfolder reverse proxy, such as our SWAG container or Traefik you will need to make sure that the `APP_URL` environment variable is set to your external domain, or it will not work.

Documentation for BookStack can be found at https://www.bookstackapp.com/docs/.

### BookStack File & Directory Paths

This container ensures certain BookStack application files & folders, such as user file upload folders, are retained within the `/config` folder so that they are persistent & accessible when the `/config` container path is bound as a volume. There may be cases, when following the BookStack documentation, that you'll need to know how these files and folders are used relative to a non-container BookStack installation.

Below is a mapping of container `/config` paths to those relative within a BookStack install directory:

- **/config container path** => **BookStack relative path**
- `/config/www/.env` => `.env`
- `/config/www/laravel.log` => `storage/logs/laravel.log`
- `/config/www/backups/` => `storage/backups/`
- `/config/log/bookstack/laravel.log` => `storage/logs/laravel.log`
- `/config/backups/` => `storage/backups/`
- `/config/www/files/` => `storage/uploads/files/`
- `/config/www/images/` => `storage/uploads/images/`
- `/config/www/themes/` => `themes/`
- `/config/www/uploads/` => `public/uploads/`

### Advanced Users (full control over the .env file)

If you wish to use the extra functionality of BookStack such as email, Memcache, LDAP and so on you will need to make your own .env file with guidance from the BookStack documentation.

When you create the container, do not set any arguments for any SQL settings. The container will copy an exemplary .env file to /config/www/.env on your host system for you to edit.


# changelog
changelogs:
- { date: "11.10.24:", desc: "Default to environment config over .env file config."}
- { date: "06.09.24:", desc: "Add php-exif for reading image EXIF data."}
- { date: "27.05.24:", desc: "Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings."}
- { date: "25.01.24:", desc: "Existing users should update: site-confs/default.conf - Cleanup default site conf." }
Expand Down
Loading