deploying PrivateBin with changed path, to keep code and data out of the document root
This commit is contained in:
parent
aa1cabad94
commit
f03a438ee5
30
Dockerfile
30
Dockerfile
@ -14,8 +14,8 @@ RUN \
|
|||||||
--with-freetype-dir=/usr/include/ \
|
--with-freetype-dir=/usr/include/ \
|
||||||
--with-png-dir=/usr/include/ \
|
--with-png-dir=/usr/include/ \
|
||||||
--with-jpeg-dir=/usr/include/ \
|
--with-jpeg-dir=/usr/include/ \
|
||||||
&& docker-php-ext-install -j$(nproc) gd \
|
&& docker-php-ext-install -j$(nproc) gd \
|
||||||
&& apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev \
|
&& apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev \
|
||||||
# Remove (some of the) default nginx config
|
# Remove (some of the) default nginx config
|
||||||
&& rm -f /etc/nginx.conf \
|
&& rm -f /etc/nginx.conf \
|
||||||
&& rm -f /etc/nginx/conf.d/default.conf \
|
&& rm -f /etc/nginx/conf.d/default.conf \
|
||||||
@ -28,17 +28,27 @@ RUN \
|
|||||||
# Create folder where the user hook into our default configs
|
# Create folder where the user hook into our default configs
|
||||||
&& mkdir -p /etc/nginx/server.d/ \
|
&& mkdir -p /etc/nginx/server.d/ \
|
||||||
&& mkdir -p /etc/nginx/location.d/ \
|
&& mkdir -p /etc/nginx/location.d/ \
|
||||||
# Remove default content from the default $DOCUMENT_ROOT ...
|
|
||||||
&& rm -rf /var/www \
|
|
||||||
# ... but ensure it exists with the right owner
|
|
||||||
&& mkdir -p /var/www \
|
|
||||||
&& echo "<?php phpinfo();" > /var/www/index.php \
|
|
||||||
&& chown -R www-data.www-data /var/www \
|
|
||||||
# Bring php-fpm configs into a more controallable state
|
# Bring php-fpm configs into a more controallable state
|
||||||
&& rm /usr/local/etc/php-fpm.d/www.conf.default \
|
&& rm /usr/local/etc/php-fpm.d/www.conf.default \
|
||||||
&& mv /usr/local/etc/php-fpm.d/docker.conf /usr/local/etc/php-fpm.d/00-docker.conf \
|
&& mv /usr/local/etc/php-fpm.d/docker.conf /usr/local/etc/php-fpm.d/00-docker.conf \
|
||||||
&& mv /usr/local/etc/php-fpm.d/www.conf /usr/local/etc/php-fpm.d/10-www.conf \
|
&& mv /usr/local/etc/php-fpm.d/www.conf /usr/local/etc/php-fpm.d/10-www.conf \
|
||||||
&& mv /usr/local/etc/php-fpm.d/zz-docker.conf /usr/local/etc/php-fpm.d/20-docker.conf
|
&& mv /usr/local/etc/php-fpm.d/zz-docker.conf /usr/local/etc/php-fpm.d/20-docker.conf \
|
||||||
|
# Install PrivateBin
|
||||||
|
&& apk add --no-cache gnupg \
|
||||||
|
&& cd /tmp \
|
||||||
|
&& curl -s https://codeload.github.com/PrivateBin/PrivateBin/tar.gz/1.1.1 | tar -xzf - \
|
||||||
|
&& rm -rf /var/www \
|
||||||
|
&& mv /tmp/PrivateBin-1.1.1 /var/www \
|
||||||
|
&& cd /var/www \
|
||||||
|
&& rm *.md \
|
||||||
|
&& mv cfg /srv \
|
||||||
|
&& mv lib /srv \
|
||||||
|
&& mv tpl /srv \
|
||||||
|
&& mv vendor /srv \
|
||||||
|
&& mkdir -p /srv/data \
|
||||||
|
&& sed -i "s#define('PATH', '');#define('PATH', '/srv/');#" index.php \
|
||||||
|
&& chown -R www-data.www-data /var/www /srv/* \
|
||||||
|
&& apk del --no-cache gnupg
|
||||||
|
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
|
|
||||||
@ -46,7 +56,7 @@ ADD etc/ /etc/
|
|||||||
ADD usr/ /usr/
|
ADD usr/ /usr/
|
||||||
|
|
||||||
# mark dirs as volumes that need to be writable, allows running the container --read-only
|
# mark dirs as volumes that need to be writable, allows running the container --read-only
|
||||||
VOLUME /tmp /var/tmp /var/run /var/log
|
VOLUME /srv/data /srv/cfg/conf.php /tmp /var/tmp /var/run /var/log
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user