privatebin/Dockerfile

50 lines
1.5 KiB
Docker
Raw Permalink Normal View History

2022-03-02 20:49:27 +00:00
FROM alpine:3.14
2017-03-28 17:46:14 +00:00
LABEL maintainer="andrey.arapov@nixaid.com"
2017-03-28 17:46:14 +00:00
2022-03-02 20:49:27 +00:00
ENV RELEASE 1.3.5
ENV PBURL https://github.com/PrivateBin/PrivateBin/
2017-03-28 17:46:14 +00:00
RUN \
# Install dependencies
apk add --no-cache gnupg php7-fpm php7-json php7-gd \
php7-opcache php7-pdo_mysql php7-pdo_pgsql tzdata \
2020-04-22 18:01:16 +00:00
&& apk upgrade --no-cache \
# Install PrivateBin
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg2 --list-public-keys || /bin/true \
&& wget -qO - https://privatebin.info/key/release.asc | gpg2 --import - \
&& cd /tmp \
&& wget -qO ${RELEASE}.tar.gz.asc ${PBURL}releases/download/${RELEASE}/PrivateBin-${RELEASE}.tar.gz.asc \
&& wget -q ${PBURL}archive/${RELEASE}.tar.gz \
&& gpg2 --verify ${RELEASE}.tar.gz.asc \
&& mkdir /var/www \
&& cd /var/www \
&& tar -xzf /tmp/${RELEASE}.tar.gz --strip 1 \
&& rm *.md cfg/conf.sample.php \
&& mv cfg lib tpl vendor /srv \
&& mkdir /srv/data \
&& sed -i "s#define('PATH', '');#define('PATH', '/srv/');#" index.php \
&& rm -rf "${GNUPGHOME}" /tmp/* \
&& apk del gnupg
2017-03-28 17:46:14 +00:00
# nginx group id must match to the nginx group id of the container running nginx (e.g. "nginx:mainline-alpine")
ENV NGINXGID 101
RUN addgroup -S -g $NGINXGID nginx
2017-03-28 17:46:14 +00:00
# Create the application user under which PHP-FPM will run
ENV USER user
ENV UID 1000
ENV HOME /home/$USER
ENV DATA /var/www
RUN adduser -D -u $UID -h $HOME -s /bin/true $USER && \
mkdir -p $DATA && \
chown -Rh $USER:$NGINXGID $DATA /srv
# Copy the php-fpm & nginx configs
COPY etc/ /etc/
2017-03-28 17:46:14 +00:00
WORKDIR $DATA
USER $USER
CMD php-fpm7 -F