2022-03-02 20:49:27 +00:00
|
|
|
FROM alpine:3.14
|
2017-03-28 17:46:14 +00:00
|
|
|
|
2020-05-17 20:43:54 +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
|
2019-09-23 05:19:50 +00:00
|
|
|
ENV PBURL https://github.com/PrivateBin/PrivateBin/
|
2018-05-28 05:31:11 +00:00
|
|
|
|
2017-03-28 17:46:14 +00:00
|
|
|
RUN \
|
|
|
|
# Install dependencies
|
2020-05-17 20:43:54 +00:00
|
|
|
apk add --no-cache gnupg php7-fpm php7-json php7-gd \
|
2019-12-21 13:21:24 +00:00
|
|
|
php7-opcache php7-pdo_mysql php7-pdo_pgsql tzdata \
|
2020-04-22 18:01:16 +00:00
|
|
|
&& apk upgrade --no-cache \
|
2018-05-28 04:44:54 +00:00
|
|
|
# Install PrivateBin
|
2018-05-28 05:31:11 +00:00
|
|
|
&& export GNUPGHOME="$(mktemp -d)" \
|
|
|
|
&& gpg2 --list-public-keys || /bin/true \
|
2019-12-21 13:21:24 +00:00
|
|
|
&& wget -qO - https://privatebin.info/key/release.asc | gpg2 --import - \
|
2018-05-28 04:44:54 +00:00
|
|
|
&& cd /tmp \
|
2019-12-21 13:21:24 +00:00
|
|
|
&& 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 \
|
2020-05-17 20:43:54 +00:00
|
|
|
&& mkdir /var/www \
|
2018-05-28 04:44:54 +00:00
|
|
|
&& cd /var/www \
|
2019-12-21 13:21:24 +00:00
|
|
|
&& tar -xzf /tmp/${RELEASE}.tar.gz --strip 1 \
|
2018-05-28 05:31:11 +00:00
|
|
|
&& rm *.md cfg/conf.sample.php \
|
2019-12-21 13:21:24 +00:00
|
|
|
&& mv cfg lib tpl vendor /srv \
|
2020-05-17 20:43:54 +00:00
|
|
|
&& mkdir /srv/data \
|
2018-05-28 04:44:54 +00:00
|
|
|
&& sed -i "s#define('PATH', '');#define('PATH', '/srv/');#" index.php \
|
2018-05-28 05:31:11 +00:00
|
|
|
&& rm -rf "${GNUPGHOME}" /tmp/* \
|
2020-04-28 05:10:27 +00:00
|
|
|
&& apk del gnupg
|
2017-03-28 17:46:14 +00:00
|
|
|
|
2020-05-17 20:43:54 +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
|
|
|
|
2020-05-17 20:43:54 +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
|
2018-05-27 21:22:08 +00:00
|
|
|
|
2020-05-17 20:43:54 +00:00
|
|
|
# Copy the php-fpm & nginx configs
|
|
|
|
COPY etc/ /etc/
|
2017-03-28 17:46:14 +00:00
|
|
|
|
2020-05-17 20:43:54 +00:00
|
|
|
WORKDIR $DATA
|
|
|
|
USER $USER
|
|
|
|
CMD php-fpm7 -F
|