Compare commits
No commits in common. "master" and "0.27.4-r0" have entirely different histories.
|
|
@ -7,6 +7,9 @@ APP_ENV=production
|
||||||
APP_DEBUG=false
|
APP_DEBUG=false
|
||||||
APP_KEY=------------REPLACE_ME------------
|
APP_KEY=------------REPLACE_ME------------
|
||||||
|
|
||||||
|
# Timezone
|
||||||
|
TZ=------------REPLACE_ME------------
|
||||||
|
|
||||||
# The below url has to be set if using social auth options
|
# 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.
|
# or if you are not using BookStack at the root path of your domain.
|
||||||
APP_URL=https://bookstackapp.com ------------REPLACE_ME------------
|
APP_URL=https://bookstackapp.com ------------REPLACE_ME------------
|
||||||
|
|
@ -31,8 +34,8 @@ APP_TIMEZONE=UTC
|
||||||
DB_HOST=db:3306
|
DB_HOST=db:3306
|
||||||
DB_DATABASE=bookstack
|
DB_DATABASE=bookstack
|
||||||
DB_USERNAME=bookstack
|
DB_USERNAME=bookstack
|
||||||
DB_PASSWORD=------------REPLACE_ME------------
|
DB_PASSWORD='------------REPLACE_ME------------'
|
||||||
DB_ROOT_PASS=------------REPLACE_ME------------
|
DB_ROOT_PASS='------------REPLACE_ME------------'
|
||||||
|
|
||||||
# Cache and session
|
# Cache and session
|
||||||
#CACHE_DRIVER=file
|
#CACHE_DRIVER=file
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
# bookstack-ppm
|
# bookstack-ppm
|
||||||
[](https://cloud.drone.io/JJTC-Containers/bookstack-ppm)
|
[](https://cloud.drone.io/JJTC-Docker/bookstack-ppm)
|
||||||
[](https://hub.docker.com/r/jjtc/bookstack-ppm/)
|
[](https://hub.docker.com/r/jjtc/bookstack-ppm/)
|
||||||
[](https://github.com/jjtc-containers/bookstack-ppm)
|
[](https://github.com/jjtc-docker/bookstack-ppm)
|
||||||
[](https://github.com/jjtc-containers/bookstack-ppm)
|
[](https://github.com/jjtc-docker/bookstack-ppm)
|
||||||
[](https://github.com/php-pm/php-pm)
|
[](https://github.com/php-pm/php-pm)
|
||||||
|
|
||||||
Bookstack setup based on Alpine, Nginx, PHP-PM, MariaDB, Redis & ClamAV for use with Træfik
|
Bookstack setup based on Alpine, Nginx, PHP-PM, MariaDB, Redis & ClamAV for use with Træfik
|
||||||
|
|
@ -1,28 +1,25 @@
|
||||||
FROM alpine:3.13
|
FROM alpine:edge
|
||||||
|
|
||||||
LABEL maintainer="JJTC <oci@jjtc.eu>"
|
LABEL maintainer="JJTC <docker@jjtc.eu>"
|
||||||
|
|
||||||
ENV PPM_VERSION=2.2.1 \
|
ENV PPM_VERSION=2.0.0 \
|
||||||
PPM_HTTP_VERSION=2.0.6 \
|
PPM_HTTP_VERSION=2.0.2 \
|
||||||
BOOKSTACK=BookStack \
|
BOOKSTACK=BookStack \
|
||||||
BOOKSTACK_VERSION=0.31.6 \
|
BOOKSTACK_VERSION=0.27.4 \
|
||||||
BOOKSTACK_HOME="/app"
|
BOOKSTACK_HOME="/app"
|
||||||
|
|
||||||
COPY entrypoint.sh /app/entrypoint.sh
|
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& chmod +x /app/entrypoint.sh \
|
&& chmod +x /app/docker-entrypoint.sh \
|
||||||
# ensure www-data user exists
|
# ensure www-data user exists
|
||||||
# 82 is the standard uid/gid for "www-data" in Alpine
|
# 82 is the standard uid/gid for "www-data" in Alpine
|
||||||
&& addgroup -g 82 -S www-data \
|
&& addgroup -g 82 -S www-data \
|
||||||
&& adduser -u 82 -D -S -G www-data www-data \
|
&& adduser -u 82 -D -S -G www-data www-data \
|
||||||
&& addgroup -S bookstack \
|
|
||||||
&& adduser -S -D -H -s /sbin/nologin -G bookstack -g bookstack bookstack \
|
|
||||||
&& apk update \
|
&& apk update \
|
||||||
&& echo "Getting packages:" \
|
&& echo "Setting up PHP extensions" \
|
||||||
&& apk add --no-cache \
|
&& apk add --no-cache \
|
||||||
curl \
|
curl \
|
||||||
multirun \
|
|
||||||
nginx \
|
nginx \
|
||||||
tar \
|
tar \
|
||||||
php7 \
|
php7 \
|
||||||
|
|
@ -50,6 +47,7 @@ RUN set -ex \
|
||||||
php7-session \
|
php7-session \
|
||||||
php7-simplexml \
|
php7-simplexml \
|
||||||
php7-sockets \
|
php7-sockets \
|
||||||
|
php7-tidy \
|
||||||
php7-tokenizer \
|
php7-tokenizer \
|
||||||
php7-xml \
|
php7-xml \
|
||||||
php7-xmlwriter \
|
php7-xmlwriter \
|
||||||
|
|
@ -58,32 +56,25 @@ RUN set -ex \
|
||||||
composer \
|
composer \
|
||||||
&& echo "Setting up PPM:" \
|
&& echo "Setting up PPM:" \
|
||||||
&& mkdir -p /ppm/run \
|
&& mkdir -p /ppm/run \
|
||||||
&& chmod 0777 /ppm/run \
|
|
||||||
&& cd /ppm \
|
&& cd /ppm \
|
||||||
|
&& chmod -R 777 run/ \
|
||||||
&& composer require php-pm/php-pm:${PPM_VERSION} php-pm/httpkernel-adapter:${PPM_HTTP_VERSION} \
|
&& composer require php-pm/php-pm:${PPM_VERSION} php-pm/httpkernel-adapter:${PPM_HTTP_VERSION} \
|
||||||
&& chown www-data:www-data -R . \
|
&& chown www-data:www-data -R . \
|
||||||
&& echo "Getting BookStack:" \
|
&& echo "Get BookStack:" \
|
||||||
&& mkdir -p ${BOOKSTACK_HOME} \
|
&& mkdir -p ${BOOKSTACK_HOME} \
|
||||||
&& cd ${BOOKSTACK_HOME} \
|
&& cd ${BOOKSTACK_HOME} \
|
||||||
&& curl -LJO https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz \
|
&& curl -LJO https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz \
|
||||||
&& tar --strip-components=1 -xzf BookStack-${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 \
|
&& rm -rf ${BOOKSTACK}-${BOOKSTACK_VERSION}.tar.gz .env.example .gitattributes .github .gitignore .travis.yml tests/ public/index.php \
|
||||||
&& ln -s init.php bootstrap/autoload.php \
|
&& ln -s init.php bootstrap/autoload.php \
|
||||||
&& echo "Getting BookStack Dependencies:" \
|
&& echo "Get Dependencies:" \
|
||||||
&& composer install \
|
&& composer install \
|
||||||
&& echo "Changing ownership:" \
|
&& echo "Changing ownership:" \
|
||||||
&& chown bookstack:bookstack -R . \
|
&& chown www-data:www-data -R . \
|
||||||
&& echo "Setting folder permissions for www-data:" \
|
&& echo "Ensure www-data got access to Nginx folders:" \
|
||||||
&& chown www-data:bookstack -R bootstrap/cache public/uploads storage \
|
&& chown www-data:www-data -R /var/lib/nginx /var/log/nginx
|
||||||
&& 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
|
USER www-data:www-data
|
||||||
|
|
||||||
WORKDIR $BOOKSTACK_HOME
|
WORKDIR $BOOKSTACK_HOME
|
||||||
|
|
||||||
|
|
@ -91,4 +82,4 @@ EXPOSE 8080/tcp
|
||||||
|
|
||||||
VOLUME ["$BOOKSTACK_HOME/public/uploads", "$BOOKSTACK_HOME/public/storage"]
|
VOLUME ["$BOOKSTACK_HOME/public/uploads", "$BOOKSTACK_HOME/public/storage"]
|
||||||
|
|
||||||
ENTRYPOINT ["multirun", "nginx", "./entrypoint.sh"]
|
ENTRYPOINT ["./docker-entrypoint.sh"]
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ server {
|
||||||
client_body_timeout 120s; # Default is 60, May need to be increased for very large uploads
|
client_body_timeout 120s; # Default is 60, May need to be increased for very large uploads
|
||||||
client_body_buffer_size 128k;
|
client_body_buffer_size 128k;
|
||||||
|
|
||||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' blob:; connect-src 'self'; font-src 'self'; form-action 'self'; frame-ancestors 'none'; report-uri https://<YOUR_ACCOUNT>.report-uri.com/r/d/csp/enforce; report-to default;" always;
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self'; connect-src 'self'; font-src 'self'; form-action 'self'; frame-ancestors 'none'; report-uri https://<YOUR_ACCOUNT>.report-uri.com/r/d/csp/enforce; report-to default;" always;
|
||||||
add_header Expect-CT "enforce; max-age=604800; report-uri=https://<YOUR_ACCOUNT>.report-uri.com/r/d/ct/enforce";
|
add_header Expect-CT "enforce; max-age=604800; report-uri=https://<YOUR_ACCOUNT>.report-uri.com/r/d/ct/enforce";
|
||||||
add_header Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; encrypted-media 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; sync-xhr 'none'; usb 'none'; vr 'none'";
|
add_header Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; encrypted-media 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; sync-xhr 'none'; usb 'none'; vr 'none'";
|
||||||
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always;
|
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
if [ ! -f /app/.env ]; then
|
||||||
|
php artisan key:generate --no-interaction --force
|
||||||
|
fi
|
||||||
|
php artisan migrate --no-interaction --force
|
||||||
|
|
||||||
|
echo "Setting folder permissions for uploads"
|
||||||
|
chown -R www-data:www-data public/uploads storage/uploads
|
||||||
|
|
||||||
|
php artisan cache:clear
|
||||||
|
php artisan view:clear
|
||||||
|
|
||||||
|
echo "Starting Nginx:"
|
||||||
|
nginx
|
||||||
|
|
||||||
|
echo "Getting PPM ready:"
|
||||||
|
trapIt() {
|
||||||
|
"$@" &
|
||||||
|
pid="$!"
|
||||||
|
trap 'kill -INT $pid' INT TERM
|
||||||
|
while kill -0 $pid >/dev/null 2>&1; do
|
||||||
|
wait $pid
|
||||||
|
ec="$?"
|
||||||
|
done
|
||||||
|
exit $ec
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Starting PPM:"
|
||||||
|
trapIt /ppm/vendor/bin/ppm start --ansi --no-interaction --config=ppm.json
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
if [ ! -f .env ]; then
|
|
||||||
php artisan key:generate --no-interaction --force
|
|
||||||
fi
|
|
||||||
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
|
|
||||||
|
|
@ -12,7 +12,7 @@ upload_max_filesize = 64M
|
||||||
expose_php=0
|
expose_php=0
|
||||||
|
|
||||||
session.save_handler = redis
|
session.save_handler = redis
|
||||||
session.save_path = "tcp://cache:6379?database=1"
|
session.save_path = "tcp://redis:6379"
|
||||||
|
|
||||||
opcache.enable=1
|
opcache.enable=1
|
||||||
opcache.enable_cli=1
|
opcache.enable_cli=1
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
version: '3.7'
|
version: '3.5'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.5
|
image: mariadb:10.4
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- TZ=${APP_TIMEZONE}
|
- TZ=${TZ}
|
||||||
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASS}
|
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASS}
|
||||||
- MYSQL_DATABASE=${DB_DATABASE}
|
- MYSQL_DATABASE=${DB_DATABASE}
|
||||||
- MYSQL_USER=${DB_USERNAME}
|
- MYSQL_USER=${DB_USERNAME}
|
||||||
|
|
@ -16,18 +15,17 @@ services:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
image: redis:6-alpine
|
image: redis:5-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- TZ=${APP_TIMEZONE}
|
- TZ=${TZ}
|
||||||
volumes:
|
volumes:
|
||||||
- cache:/data/
|
- cache:/data/
|
||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: jjtc/bookstack-ppm:0.31.6-r0
|
image: jjtc/bookstack-ppm:0.27.4-r0
|
||||||
init: true
|
|
||||||
build: ./app/
|
build: ./app/
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
@ -47,16 +45,14 @@ services:
|
||||||
- web
|
- web
|
||||||
- backend
|
- backend
|
||||||
labels:
|
labels:
|
||||||
|
- "traefik.frontend.headers.STSPreload=true"
|
||||||
|
- "traefik.frontend.headers.STSSeconds=31536000"
|
||||||
|
- "traefik.backend=bookstack"
|
||||||
|
- "traefik.docker.network=web"
|
||||||
|
- "traefik.frontend.rule=Host:${APP_URL_BASE}"
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.bookstack.entrypoints=http"
|
- "traefik.port=8888"
|
||||||
- "traefik.http.routers.bookstack.rule=Host(`${APP_URL_BASE}`)"
|
- "traefik.default.protocol=http"
|
||||||
- "traefik.http.routers.bookstack-secure.entrypoints=https"
|
|
||||||
- "traefik.http.routers.bookstack-secure.rule=Host(`${APP_URL_BASE}`)"
|
|
||||||
- "traefik.http.routers.bookstack-secure.tls=true"
|
|
||||||
- "traefik.http.routers.bookstack-secure.tls.certresolver=default"
|
|
||||||
- "traefik.http.routers.bookstack-secure.service=bookstack"
|
|
||||||
- "traefik.http.services.bookstack.loadbalancer.server.scheme=http"
|
|
||||||
- "traefik.http.services.bookstack.loadbalancer.server.port=8888"
|
|
||||||
|
|
||||||
# av:
|
# av:
|
||||||
# image: jjtc/av:0.100.0-r0
|
# image: jjtc/av:0.100.0-r0
|
||||||
|
|
@ -73,24 +69,14 @@ services:
|
||||||
# - "traefik.enable=false"
|
# - "traefik.enable=false"
|
||||||
|
|
||||||
#traefik:
|
#traefik:
|
||||||
# image: traefik:2.4
|
# image: traefik:latest
|
||||||
# restart: unless-stopped
|
# restart: unless-stopped
|
||||||
# security_opt:
|
# command: traefik --docker --acme=true --acme.domains='your.domain.tld' --acme.email='your@email.tld' --acme.entrypoint=https --acme.storagefile=acme.json --defaultentrypoints=http --defaultentrypoints=https --entryPoints='Name$
|
||||||
# - no-new-privileges:true
|
|
||||||
# command:
|
|
||||||
# - --entrypoints.web.address=:80
|
|
||||||
# - --entrypoints.websecure.address=:443
|
|
||||||
# - --providers.docker=true
|
|
||||||
- # - --certificatesresolvers.leresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
|
|
||||||
# - --certificatesresolvers.leresolver.acme.email=your@email.com
|
|
||||||
# - --certificatesresolvers.leresolver.acme.storage=/acme.json
|
|
||||||
# - --certificatesresolvers.leresolver.acme.tlschallenge=true
|
|
||||||
# ports:
|
# ports:
|
||||||
# - "80:80/tcp"
|
# - 80:80
|
||||||
# - "443:443/tcp
|
# - 443:443
|
||||||
# volumes:
|
# volumes:
|
||||||
# - "/var/run/docker.sock:/var/run/docker.sock:ro"
|
# - /var/run/docker.sock:/var/run/docker.sock
|
||||||
# - "./acme.json:/acme.json:rw"
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
backend:
|
backend:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue