Add async action support

This commit is contained in:
TheSpad 2023-09-04 09:22:10 +01:00
parent e3bcaad822
commit 869d618156
No known key found for this signature in database
GPG Key ID: 08F06191F4587860
8 changed files with 25 additions and 8 deletions

View File

@ -9,8 +9,7 @@ ARG BOOKSTACK_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="homerr"
# package versions
ARG BOOKSTACK_RELEASE
ENV S6_STAGE2_HOOK="/init-hook"
RUN \
echo "**** install runtime packages ****" && \

View File

@ -9,8 +9,7 @@ ARG BOOKSTACK_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="homerr"
# package versions
ARG BOOKSTACK_RELEASE
ENV S6_STAGE2_HOOK="/init-hook"
RUN \
echo "**** install runtime packages ****" && \

View File

@ -89,7 +89,7 @@ Below is a mapping of container `/config` paths to those relative within a BookS
### 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.
## Usage
@ -152,6 +152,7 @@ docker run -d \
-e DB_USER=<yourdbuser> \
-e DB_PASS=<yourdbpass> \
-e DB_DATABASE=bookstackapp \
-e QUEUE_CONNECTION= `#optional` \
-p 6875:80 \
-v /path/to/data:/config \
--restart unless-stopped \
@ -175,6 +176,7 @@ Container images are configured using parameters passed at runtime (such as thos
| `-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 QUEUE_CONNECTION=` | Set to `database` to enable async actions like sending email or triggering webhooks. |
| `-v /config` | this will store any uploaded data on the docker host |
## Environment variables from files (Docker secrets)

View File

@ -36,8 +36,9 @@ param_usage_include_ports: true
param_ports:
- { external_port: "6875", internal_port: "80", port_desc: "will map the container's port 80 to port 6875 on the host" }
opt_param_usage_include_env: false
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." }
custom_compose: |
---
@ -85,7 +86,7 @@ app_setup_block: |
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/.
@ -106,7 +107,7 @@ app_setup_block: |
### 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.

View File

@ -0,0 +1,6 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
echo "*** Starting Async Action Queue ***"
exec /usr/bin/php /app/www/artisan queue:work --sleep=3 --tries=1 --max-time=3600

View File

@ -0,0 +1 @@
longrun

9
root/init-hook Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
if [[ -n "${QUEUE_CONNECTION}" ]]; then
touch /etc/s6-overlay/s6-rc.d/user/contents.d/svc-queue-worker
fi
exec \
/docker-mods