Merge pull request #187 from linuxserver/queues

This commit is contained in:
Adam 2023-09-04 12:01:45 +01:00 committed by GitHub
commit b979032c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 30 additions and 13 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

@ -25,19 +25,20 @@ param_volumes:
param_usage_include_env: true
param_env_vars:
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"}
- { 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: "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" }
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. See [documentation](https://www.bookstackapp.com/docs/admin/email-webhooks/#async-action-handling)." }
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