Skip to content

Commit 2c3eb82

Browse files
authored
Merge pull request #231 from linuxserver/env-consolidation
2 parents e32e3ce + be960b4 commit 2c3eb82

File tree

7 files changed

+74
-187
lines changed

7 files changed

+74
-187
lines changed

Diff for: Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG BUILD_DATE
77
ARG VERSION
88
ARG BOOKSTACK_RELEASE
99
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
10-
LABEL maintainer="homerr"
10+
LABEL maintainer="thespad"
1111

1212
ENV S6_STAGE2_HOOK="/init-hook"
1313

Diff for: Dockerfile.aarch64

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG BUILD_DATE
77
ARG VERSION
88
ARG BOOKSTACK_RELEASE
99
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
10-
LABEL maintainer="homerr"
10+
LABEL maintainer="thespad"
1111

1212
ENV S6_STAGE2_HOOK="/init-hook"
1313

Diff for: Jenkinsfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ pipeline {
3131
PR_DOCKERHUB_IMAGE = 'lspipepr/bookstack'
3232
DIST_IMAGE = 'alpine'
3333
MULTIARCH = 'true'
34-
CI = 'true'
34+
CI = 'false'
3535
CI_WEB = 'false'
3636
CI_PORT = '80'
3737
CI_SSL = 'false'
3838
CI_DELAY = '60'
39-
CI_DOCKERENV='TEST_RUN=1'
39+
CI_DOCKERENV=''
4040
CI_AUTH = ''
4141
CI_WEBPATH = ''
4242
}

Diff for: README.md

+35-42
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Find us at:
3737
[![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)
3838
[![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)
3939
[![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/)
40-
[![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)
4140

4241
[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.
4342

@@ -63,30 +62,39 @@ The architectures supported by this image are:
6362

6463
## Application Setup
6564

66-
The default username is [email protected] with the password of **password**, access the container at http://dockerhost:6875.
65+
The default username is [email protected] with the password of **password**, access the container at http://<host ip>:6875.
6766

6867
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/.
6968

70-
7169
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.
7270

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

7573
### BookStack File & Directory Paths
74+
7675
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.
7776

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

8079
- **/config container path** => **BookStack relative path**
8180
- `/config/www/.env` => `.env`
82-
- `/config/www/laravel.log` => `storage/logs/laravel.log`
83-
- `/config/www/backups/` => `storage/backups/`
81+
- `/config/log/bookstack/laravel.log` => `storage/logs/laravel.log`
82+
- `/config/backups/` => `storage/backups/`
8483
- `/config/www/files/` => `storage/uploads/files/`
8584
- `/config/www/images/` => `storage/uploads/images/`
8685
- `/config/www/themes/` => `themes/`
8786
- `/config/www/uploads/` => `public/uploads/`
8887

88+
### Changing APP_URL
89+
90+
If you change the APP_URL after initial install, you should run the following line from your host terminal to update the database URL entries:
91+
92+
```shell
93+
docker exec -it bookstack php /app/www/artisan bookstack:update-url ${OLD_URL} ${NEW_URL}
94+
```
95+
8996
### Advanced Users (full control over the .env file)
97+
9098
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.
9199

92100
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.
@@ -101,40 +109,24 @@ To help you get started creating a container from this image you can either use
101109
---
102110
services:
103111
bookstack:
104-
image: lscr.io/linuxserver/bookstack
112+
image: lscr.io/linuxserver/bookstack:latest
105113
container_name: bookstack
106114
environment:
107115
- PUID=1000
108116
- PGID=1000
109-
- TZ=Europe/London
110-
- APP_URL=https://bookstack.example.com
111-
- DB_HOST=bookstack_db
117+
- TZ=Etc/UTC
118+
- APP_URL=
119+
- DB_HOST=
112120
- DB_PORT=3306
113-
- DB_USER=bookstack
114-
- DB_PASS=<yourdbpass>
115-
- DB_DATABASE=bookstackapp
121+
- DB_USERNAME=
122+
- DB_PASSWORD=
123+
- DB_DATABASE=
124+
- QUEUE_CONNECTION= #optional
116125
volumes:
117-
- /path/to/bookstack_app_data:/config
126+
- /path/to/bookstack/config:/config
118127
ports:
119128
- 6875:80
120129
restart: unless-stopped
121-
depends_on:
122-
- bookstack_db
123-
124-
bookstack_db:
125-
image: lscr.io/linuxserver/mariadb
126-
container_name: bookstack_db
127-
environment:
128-
- PUID=1000
129-
- PGID=1000
130-
- TZ=Europe/London
131-
- MYSQL_ROOT_PASSWORD=<yourdbpass>
132-
- MYSQL_DATABASE=bookstackapp
133-
- MYSQL_USER=bookstack
134-
- MYSQL_PASSWORD=<yourdbpass>
135-
volumes:
136-
- /path/to/bookstack_db_data:/config
137-
restart: unless-stopped
138130
```
139131
140132
### docker cli ([click here for more info](https://docs.docker.com/engine/reference/commandline/cli/))
@@ -145,12 +137,12 @@ docker run -d \
145137
-e PUID=1000 \
146138
-e PGID=1000 \
147139
-e TZ=Etc/UTC \
148-
-e APP_URL=yourbaseurl \
149-
-e DB_HOST=yourdbhost \
150-
-e DB_PORT=yourdbport \
151-
-e DB_USER=yourdbuser \
152-
-e DB_PASS=yourdbpass \
153-
-e DB_DATABASE=bookstackapp \
140+
-e APP_URL= \
141+
-e DB_HOST= \
142+
-e DB_PORT=3306 \
143+
-e DB_USERNAME= \
144+
-e DB_PASSWORD= \
145+
-e DB_DATABASE= \
154146
-e QUEUE_CONNECTION= `#optional` \
155147
-p 6875:80 \
156148
-v /path/to/bookstack/config:/config \
@@ -168,12 +160,12 @@ Containers are configured using parameters passed at runtime (such as those abov
168160
| `-e PUID=1000` | for UserID - see below for explanation |
169161
| `-e PGID=1000` | for GroupID - see below for explanation |
170162
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
171-
| `-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` |
172-
| `-e DB_HOST=yourdbhost` | for specifying the database host |
173-
| `-e DB_PORT=yourdbport` | for specifying the database port if not default 3306 |
174-
| `-e DB_USER=yourdbuser` | for specifying the database user |
175-
| `-e DB_PASS=yourdbpass` | for specifying the database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.) |
176-
| `-e DB_DATABASE=bookstackapp` | for specifying the database to be used |
163+
| `-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` |
164+
| `-e DB_HOST=` | The database instance hostname |
165+
| `-e DB_PORT=3306` | Database port (default `3306`) |
166+
| `-e DB_USERNAME=` | Database user |
167+
| `-e DB_PASSWORD=` | Database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.) |
168+
| `-e DB_DATABASE=` | Database name |
177169
| `-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). |
178170
| `-v /config` | Persistent config files |
179171

@@ -339,6 +331,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
339331

340332
## Versions
341333

334+
* **11.10.24:** - Default to environment config over .env file config.
342335
* **06.09.24:** - Add php-exif for reading image EXIF data.
343336
* **27.05.24:** - Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings.
344337
* **25.01.24:** - Existing users should update: site-confs/default.conf - Cleanup default site conf.

Diff for: jenkins-vars.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ repo_vars:
1919
- PR_DOCKERHUB_IMAGE = 'lspipepr/bookstack'
2020
- DIST_IMAGE = 'alpine'
2121
- MULTIARCH = 'true'
22-
- CI = 'true'
22+
- CI = 'false'
2323
- CI_WEB = 'false'
2424
- CI_PORT = '80'
2525
- CI_SSL = 'false'
2626
- CI_DELAY = '60'
27-
- CI_DOCKERENV='TEST_RUN=1'
27+
- CI_DOCKERENV=''
2828
- CI_AUTH = ''
2929
- CI_WEBPATH = ''

Diff for: readme-vars.yml

+20-50
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ param_volumes:
2424
- { vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/config", desc: "Persistent config files" }
2525
param_usage_include_env: true
2626
param_env_vars:
27-
- { 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`"}
28-
- { env_var: "DB_HOST", env_value: "yourdbhost", desc: "for specifying the database host" }
29-
- { env_var: "DB_PORT", env_value: "yourdbport", desc: "for specifying the database port if not default 3306" }
30-
- { env_var: "DB_USER", env_value: "yourdbuser", desc: "for specifying the database user" }
31-
- { env_var: "DB_PASS", env_value: "yourdbpass", desc: "for specifying the database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.)" }
32-
- { env_var: "DB_DATABASE", env_value: "bookstackapp", desc: "for specifying the database to be used" }
27+
- { 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`"}
28+
- { env_var: "DB_HOST", env_value: "", desc: "The database instance hostname" }
29+
- { env_var: "DB_PORT", env_value: "3306", desc: "Database port (default `3306`)" }
30+
- { env_var: "DB_USERNAME", env_value: "", desc: "Database user" }
31+
- { env_var: "DB_PASSWORD", env_value: "", desc: "Database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.)" }
32+
- { env_var: "DB_DATABASE", env_value: "", desc: "Database name" }
3333

3434
param_usage_include_ports: true
3535
param_ports:
@@ -39,80 +39,50 @@ opt_param_usage_include_env: true
3939
opt_param_env_vars:
4040
- { 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)." }
4141

42-
custom_compose: |
43-
---
44-
services:
45-
bookstack:
46-
image: lscr.io/linuxserver/bookstack
47-
container_name: bookstack
48-
environment:
49-
- PUID=1000
50-
- PGID=1000
51-
- TZ=Europe/London
52-
- APP_URL=https://bookstack.example.com
53-
- DB_HOST=bookstack_db
54-
- DB_PORT=3306
55-
- DB_USER=bookstack
56-
- DB_PASS=<yourdbpass>
57-
- DB_DATABASE=bookstackapp
58-
volumes:
59-
- /path/to/bookstack_app_data:/config
60-
ports:
61-
- 6875:80
62-
restart: unless-stopped
63-
depends_on:
64-
- bookstack_db
65-
66-
bookstack_db:
67-
image: lscr.io/linuxserver/mariadb
68-
container_name: bookstack_db
69-
environment:
70-
- PUID=1000
71-
- PGID=1000
72-
- TZ=Europe/London
73-
- MYSQL_ROOT_PASSWORD=<yourdbpass>
74-
- MYSQL_DATABASE=bookstackapp
75-
- MYSQL_USER=bookstack
76-
- MYSQL_PASSWORD=<yourdbpass>
77-
volumes:
78-
- /path/to/bookstack_db_data:/config
79-
restart: unless-stopped
80-
8142
# application setup block
8243
app_setup_block_enabled: true
8344
app_setup_block: |
8445
85-
The default username is [email protected] with the password of **password**, access the container at http://dockerhost:6875.
46+
The default username is [email protected] with the password of **password**, access the container at http://<host ip>:6875.
8647
8748
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/.
8849
89-
9050
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.
9151
9252
Documentation for BookStack can be found at https://www.bookstackapp.com/docs/.
9353
9454
### BookStack File & Directory Paths
55+
9556
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.
9657
9758
Below is a mapping of container `/config` paths to those relative within a BookStack install directory:
9859
9960
- **/config container path** => **BookStack relative path**
10061
- `/config/www/.env` => `.env`
101-
- `/config/www/laravel.log` => `storage/logs/laravel.log`
102-
- `/config/www/backups/` => `storage/backups/`
62+
- `/config/log/bookstack/laravel.log` => `storage/logs/laravel.log`
63+
- `/config/backups/` => `storage/backups/`
10364
- `/config/www/files/` => `storage/uploads/files/`
10465
- `/config/www/images/` => `storage/uploads/images/`
10566
- `/config/www/themes/` => `themes/`
10667
- `/config/www/uploads/` => `public/uploads/`
10768
69+
### Changing APP_URL
70+
71+
If you change the APP_URL after initial install, you should run the following line from your host terminal to update the database URL entries:
72+
73+
```shell
74+
docker exec -it bookstack php /app/www/artisan bookstack:update-url ${OLD_URL} ${NEW_URL}
75+
```
76+
10877
### Advanced Users (full control over the .env file)
78+
10979
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.
11080
11181
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.
11282
113-
11483
# changelog
11584
changelogs:
85+
- { date: "11.10.24:", desc: "Default to environment config over .env file config."}
11686
- { date: "06.09.24:", desc: "Add php-exif for reading image EXIF data."}
11787
- { date: "27.05.24:", desc: "Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings."}
11888
- { date: "25.01.24:", desc: "Existing users should update: site-confs/default.conf - Cleanup default site conf." }

0 commit comments

Comments
 (0)