Compare commits
1 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
0d196676a7 |
|
|
@ -7,6 +7,9 @@ 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------------
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ LABEL maintainer="JJTC <oci@jjtc.eu>"
|
|||
|
||||
ENV PPM_VERSION=2.2.1 \
|
||||
PPM_HTTP_VERSION=2.0.6 \
|
||||
COMPOSER_VERSION=2.0.11 \
|
||||
BOOKSTACK=BookStack \
|
||||
BOOKSTACK_VERSION=0.31.6 \
|
||||
BOOKSTACK_HOME="/app"
|
||||
|
|
@ -19,71 +20,70 @@ RUN set -ex \
|
|||
&& addgroup -S bookstack \
|
||||
&& adduser -S -D -H -s /sbin/nologin -G bookstack -g bookstack bookstack \
|
||||
&& apk update \
|
||||
&& echo "Getting packages:" \
|
||||
&& echo "Setting up PHP extensions" \
|
||||
&& apk add --no-cache \
|
||||
curl \
|
||||
multirun \
|
||||
nginx \
|
||||
tar \
|
||||
php7 \
|
||||
php7-cgi \
|
||||
php7-ctype \
|
||||
php7-curl \
|
||||
php7-dom \
|
||||
php7-exif \
|
||||
php7-fileinfo \
|
||||
php7-gd \
|
||||
php7-iconv \
|
||||
php7-intl \
|
||||
php7-json \
|
||||
php7-ldap \
|
||||
php7-mbstring \
|
||||
php7-mcrypt \
|
||||
php7-opcache \
|
||||
php7-openssl \
|
||||
php7-pcntl \
|
||||
php7-pdo_mysql \
|
||||
php7-pecl-imagick \
|
||||
php7-phar \
|
||||
php7-posix \
|
||||
php7-redis \
|
||||
php7-session \
|
||||
php7-simplexml \
|
||||
php7-sockets \
|
||||
php7-tokenizer \
|
||||
php7-xml \
|
||||
php7-xmlwriter \
|
||||
php7-zip \
|
||||
php7-zlib \
|
||||
composer \
|
||||
php8 \
|
||||
php8-cgi \
|
||||
php8-ctype \
|
||||
php8-curl \
|
||||
php8-dom \
|
||||
php8-exif \
|
||||
php8-fileinfo \
|
||||
php8-gd \
|
||||
php8-iconv \
|
||||
php8-intl \
|
||||
php8-json \
|
||||
php8-ldap \
|
||||
php8-mbstring \
|
||||
php8-opcache \
|
||||
php8-openssl \
|
||||
php8-pcntl \
|
||||
php8-pdo_mysql \
|
||||
php8-pecl-imagick \
|
||||
php8-phar \
|
||||
php8-posix \
|
||||
php8-redis \
|
||||
php8-session \
|
||||
php8-simplexml \
|
||||
php8-sockets \
|
||||
php8-tokenizer \
|
||||
php8-xml \
|
||||
php8-xmlwriter \
|
||||
php8-zip \
|
||||
php8-zlib \
|
||||
&& echo "Setting up Composer" \
|
||||
&& ln -sf /usr/bin/php8 /usr/bin/php \
|
||||
&& curl https://getcomposer.org/download/$COMPOSER_VERSION/composer.phar -o /usr/bin/composer \
|
||||
&& chmod 0755 /usr/bin/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 "Getting BookStack:" \
|
||||
&& echo "Get 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 "Getting BookStack Dependencies:" \
|
||||
&& echo "Get 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 "Ensuring www-data got access to Nginx folders:" \
|
||||
&& echo "Ensure 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
|
||||
USER www-data:www-data
|
||||
|
||||
WORKDIR $BOOKSTACK_HOME
|
||||
|
||||
|
|
@ -91,4 +91,4 @@ EXPOSE 8080/tcp
|
|||
|
||||
VOLUME ["$BOOKSTACK_HOME/public/uploads", "$BOOKSTACK_HOME/public/storage"]
|
||||
|
||||
ENTRYPOINT ["multirun", "nginx", "./entrypoint.sh"]
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
if [ ! -f .env ]; then
|
||||
if [ ! -f /app/.env ]; then
|
||||
php artisan key:generate --no-interaction --force
|
||||
fi
|
||||
php artisan migrate --no-interaction --force
|
||||
|
|
@ -9,5 +9,19 @@ php artisan migrate --no-interaction --force
|
|||
php artisan cache:clear
|
||||
php artisan view:clear
|
||||
|
||||
echo "Starting PPM:"
|
||||
/ppm/vendor/bin/ppm start --ansi --no-interaction --config=ppm.json
|
||||
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 )"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
worker_processes auto;
|
||||
pid /tmp/nginx.pid;
|
||||
pid /tmp/nginx.pid;
|
||||
daemon on;
|
||||
|
||||
events {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ upload_max_filesize = 64M
|
|||
expose_php=0
|
||||
|
||||
session.save_handler = redis
|
||||
session.save_path = "tcp://cache:6379?database=1"
|
||||
session.save_path = "tcp://redis:6379?database=1"
|
||||
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@
|
|||
"socket-path": "\/ppm\/run\/",
|
||||
"pidfile": "\/ppm\/ppm.pid",
|
||||
"reload-timeout": 30,
|
||||
"cgi-path": "\/usr\/bin\/php-cgi7"
|
||||
"cgi-path": "\/usr\/bin\/php-cgi8"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: mariadb:10.5
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- TZ=${APP_TIMEZONE}
|
||||
- TZ=${TZ}
|
||||
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASS}
|
||||
- MYSQL_DATABASE=${DB_DATABASE}
|
||||
- MYSQL_USER=${DB_USERNAME}
|
||||
|
|
@ -19,7 +18,7 @@ services:
|
|||
image: redis:6-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- TZ=${APP_TIMEZONE}
|
||||
- TZ=${TZ}
|
||||
volumes:
|
||||
- cache:/data/
|
||||
networks:
|
||||
|
|
@ -27,7 +26,6 @@ services:
|
|||
|
||||
app:
|
||||
image: jjtc/bookstack-ppm:0.31.6-r0
|
||||
init: true
|
||||
build: ./app/
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
|
|
@ -50,6 +48,7 @@ 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"
|
||||
|
|
@ -73,7 +72,7 @@ services:
|
|||
# - "traefik.enable=false"
|
||||
|
||||
#traefik:
|
||||
# image: traefik:2.4
|
||||
# image: traefik:2.1
|
||||
# restart: unless-stopped
|
||||
# security_opt:
|
||||
# - no-new-privileges:true
|
||||
|
|
|
|||
Loading…
Reference in New Issue