Skip to content

Commit b979032

Browse files
authored
Merge pull request #187 from linuxserver/queues
2 parents e3bcaad + 7245559 commit b979032

File tree

8 files changed

+30
-13
lines changed

8 files changed

+30
-13
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ ARG BOOKSTACK_RELEASE
99
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
1010
LABEL maintainer="homerr"
1111

12-
# package versions
13-
ARG BOOKSTACK_RELEASE
12+
ENV S6_STAGE2_HOOK="/init-hook"
1413

1514
RUN \
1615
echo "**** install runtime packages ****" && \

Dockerfile.aarch64

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ ARG BOOKSTACK_RELEASE
99
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
1010
LABEL maintainer="homerr"
1111

12-
# package versions
13-
ARG BOOKSTACK_RELEASE
12+
ENV S6_STAGE2_HOOK="/init-hook"
1413

1514
RUN \
1615
echo "**** install runtime packages ****" && \

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Below is a mapping of container `/config` paths to those relative within a BookS
8989

9090
### Advanced Users (full control over the .env file)
9191
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.
92-
92+
9393
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.
9494

9595
## Usage
@@ -152,6 +152,7 @@ docker run -d \
152152
-e DB_USER=<yourdbuser> \
153153
-e DB_PASS=<yourdbpass> \
154154
-e DB_DATABASE=bookstackapp \
155+
-e QUEUE_CONNECTION= `#optional` \
155156
-p 6875:80 \
156157
-v /path/to/data:/config \
157158
--restart unless-stopped \
@@ -175,6 +176,7 @@ Container images are configured using parameters passed at runtime (such as thos
175176
| `-e DB_USER=<yourdbuser>` | for specifying the database user |
176177
| `-e DB_PASS=<yourdbpass>` | for specifying the database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.) |
177178
| `-e DB_DATABASE=bookstackapp` | for specifying the database to be used |
179+
| `-e QUEUE_CONNECTION=` | Set to `database` to enable async actions like sending email or triggering webhooks. |
178180
| `-v /config` | this will store any uploaded data on the docker host |
179181

180182
## Environment variables from files (Docker secrets)

readme-vars.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,20 @@ param_volumes:
2525
param_usage_include_env: true
2626
param_env_vars:
2727
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"}
28-
- { 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`"}
29-
- { env_var: "DB_HOST", env_value: "<yourdbhost>", desc: "for specifying the database host" }
30-
- { env_var: "DB_PORT", env_value: "<yourdbport>", desc: "for specifying the database port if not default 3306" }
31-
- { env_var: "DB_USER", env_value: "<yourdbuser>", desc: "for specifying the database user" }
32-
- { env_var: "DB_PASS", env_value: "<yourdbpass>", desc: "for specifying the database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.)" }
28+
- { 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`"}
29+
- { env_var: "DB_HOST", env_value: "yourdbhost", desc: "for specifying the database host" }
30+
- { env_var: "DB_PORT", env_value: "yourdbport", desc: "for specifying the database port if not default 3306" }
31+
- { env_var: "DB_USER", env_value: "yourdbuser", desc: "for specifying the database user" }
32+
- { env_var: "DB_PASS", env_value: "yourdbpass", desc: "for specifying the database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.)" }
3333
- { env_var: "DB_DATABASE", env_value: "bookstackapp", desc: "for specifying the database to be used" }
3434

3535
param_usage_include_ports: true
3636
param_ports:
3737
- { external_port: "6875", internal_port: "80", port_desc: "will map the container's port 80 to port 6875 on the host" }
3838

39-
opt_param_usage_include_env: false
39+
opt_param_usage_include_env: true
4040
opt_param_env_vars:
41+
- { 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)." }
4142

4243
custom_compose: |
4344
---
@@ -85,7 +86,7 @@ app_setup_block: |
8586
8687
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/.
8788
88-
89+
8990
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.
9091
9192
Documentation for BookStack can be found at https://www.bookstackapp.com/docs/.
@@ -106,7 +107,7 @@ app_setup_block: |
106107
107108
### Advanced Users (full control over the .env file)
108109
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.
109-
110+
110111
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.
111112
112113

root/etc/s6-overlay/s6-rc.d/svc-queue-worker/dependencies.d/init-services

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/with-contenv bash
2+
# shellcheck shell=bash
3+
4+
echo "*** Starting Async Action Queue ***"
5+
6+
exec /usr/bin/php /app/www/artisan queue:work --sleep=3 --tries=1 --max-time=3600
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
longrun

root/init-hook

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/with-contenv bash
2+
# shellcheck shell=bash
3+
4+
if [[ -n "${QUEUE_CONNECTION}" ]]; then
5+
touch /etc/s6-overlay/s6-rc.d/user/contents.d/svc-queue-worker
6+
fi
7+
8+
exec \
9+
/docker-mods

0 commit comments

Comments
 (0)