Compare commits

..

4 Commits

Author SHA1 Message Date
TBK 69cf33eb47
Entrypoint tweaks 2021-02-25 22:49:25 +01:00
TBK a4cbf7d5eb
Switch to Alpine 3.13 2021-02-25 10:59:34 +01:00
TBK 94eba4bee2
Update to 0.31.6 2021-02-25 10:56:21 +01:00
TBK c1cfee6015
Update php-pm to 2.2.1 2021-02-25 10:54:52 +01:00
6 changed files with 25 additions and 38 deletions

View File

@ -7,9 +7,6 @@ APP_ENV=production
APP_DEBUG=false
APP_KEY=------------REPLACE_ME------------
# Timezone
TZ=------------REPLACE_ME------------
# The below url has to be set if using social auth options
# or if you are not using BookStack at the root path of your domain.
APP_URL=https://bookstackapp.com ------------REPLACE_ME------------

View File

@ -1,11 +1,11 @@
FROM alpine:3.12
FROM alpine:3.13
LABEL maintainer="JJTC <oci@jjtc.eu>"
ENV PPM_VERSION=2.2.0 \
ENV PPM_VERSION=2.2.1 \
PPM_HTTP_VERSION=2.0.6 \
BOOKSTACK=BookStack \
BOOKSTACK_VERSION=0.31.4 \
BOOKSTACK_VERSION=0.31.6 \
BOOKSTACK_HOME="/app"
COPY entrypoint.sh /app/entrypoint.sh
@ -19,7 +19,7 @@ RUN set -ex \
&& addgroup -S bookstack \
&& adduser -S -D -H -s /sbin/nologin -G bookstack -g bookstack bookstack \
&& apk update \
&& echo "Setting up PHP extensions" \
&& echo "Getting packages:" \
&& apk add --no-cache \
curl \
multirun \
@ -58,29 +58,32 @@ RUN set -ex \
composer \
&& echo "Setting up PPM:" \
&& mkdir -p /ppm/run \
&& chmod 0777 /ppm/run \
&& cd /ppm \
&& chmod -R 777 run/ \
&& composer require php-pm/php-pm:${PPM_VERSION} php-pm/httpkernel-adapter:${PPM_HTTP_VERSION} \
&& chown www-data:www-data -R . \
&& echo "Get BookStack:" \
&& echo "Getting BookStack:" \
&& mkdir -p ${BOOKSTACK_HOME} \
&& cd ${BOOKSTACK_HOME} \
&& curl -LJO https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz \
&& tar --strip-components=1 -xzf BookStack-${BOOKSTACK_VERSION}.tar.gz \
&& rm -rf ${BOOKSTACK}-${BOOKSTACK_VERSION}.tar.gz .env.example .env.example.complete .gitattributes .github .gitignore .travis.yml tests/ public/index.php \
&& ln -s init.php bootstrap/autoload.php \
&& echo "Get Dependencies:" \
&& echo "Getting BookStack Dependencies:" \
&& composer install \
&& echo "Changing ownership:" \
&& chown bookstack:bookstack -R . \
&& echo "Setting folder permissions for www-data:" \
&& chown www-data:bookstack -R bootstrap/cache public/uploads storage \
&& echo "Ensure www-data got access to Nginx folders:" \
&& echo "Ensuring www-data got access to Nginx folders:" \
&& chown www-data:www-data -R /var/lib/nginx /var/log/nginx \
&& echo "Redirecting Nginx logs to stdout and stderr:" \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& echo "Giving all system users access to multirun:" \
&& chmod 0755 /usr/bin/multirun
USER www-data:www-data
USER www-data
WORKDIR $BOOKSTACK_HOME
@ -88,4 +91,4 @@ EXPOSE 8080/tcp
VOLUME ["$BOOKSTACK_HOME/public/uploads", "$BOOKSTACK_HOME/public/storage"]
ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["multirun", "nginx", "./entrypoint.sh"]

View File

@ -1,7 +1,7 @@
#!/bin/sh
set -ex
if [ ! -f /app/.env ]; then
if [ ! -f .env ]; then
php artisan key:generate --no-interaction --force
fi
php artisan migrate --no-interaction --force
@ -9,19 +9,5 @@ php artisan migrate --no-interaction --force
php artisan cache:clear
php artisan view:clear
echo "Getting PPM ready:"
trapIt() {
"$@" &
pid="$!"
for SGNL in INT TERM CHLD USR1; do
trap "kill -$SGNL $pid" "$SGNL";
done
while kill -0 $pid >/dev/null 2>&1; do
wait $pid
ec="$?"
done
exit $ec
}
echo "Starting Nginx & PPM:"
multirun "nginx" "$( trapIt /ppm/vendor/bin/ppm start --ansi --no-interaction --config=ppm.json )"
echo "Starting PPM:"
/ppm/vendor/bin/ppm start --ansi --no-interaction --config=ppm.json

View File

@ -12,7 +12,7 @@ upload_max_filesize = 64M
expose_php=0
session.save_handler = redis
session.save_path = "tcp://redis:6379?database=1"
session.save_path = "tcp://cache:6379?database=1"
opcache.enable=1
opcache.enable_cli=1

View File

@ -1,10 +1,11 @@
version: '3.7'
services:
db:
image: mariadb:10.5
restart: unless-stopped
environment:
- TZ=${TZ}
- TZ=${APP_TIMEZONE}
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASS}
- MYSQL_DATABASE=${DB_DATABASE}
- MYSQL_USER=${DB_USERNAME}
@ -15,17 +16,18 @@ services:
- backend
cache:
image: redis:5-alpine
image: redis:6-alpine
restart: unless-stopped
environment:
- TZ=${TZ}
- TZ=${APP_TIMEZONE}
volumes:
- cache:/data/
networks:
- backend
app:
image: jjtc/bookstack-ppm:0.31.4-r0
image: jjtc/bookstack-ppm:0.31.6-r0
init: true
build: ./app/
restart: unless-stopped
depends_on:
@ -48,7 +50,6 @@ services:
- "traefik.enable=true"
- "traefik.http.routers.bookstack.entrypoints=http"
- "traefik.http.routers.bookstack.rule=Host(`${APP_URL_BASE}`)"
- "traefik.http.routers.bookstack.middlewares=redirect-https@file"
- "traefik.http.routers.bookstack-secure.entrypoints=https"
- "traefik.http.routers.bookstack-secure.rule=Host(`${APP_URL_BASE}`)"
- "traefik.http.routers.bookstack-secure.tls=true"
@ -72,7 +73,7 @@ services:
# - "traefik.enable=false"
#traefik:
# image: traefik:2.1
# image: traefik:2.4
# restart: unless-stopped
# security_opt:
# - no-new-privileges:true