From 0a5752c40e1753b184ed6f558f9c10fa03ec9030 Mon Sep 17 00:00:00 2001 From: Joao Alves Date: Fri, 14 May 2021 12:16:30 +0100 Subject: [PATCH] Dockerfiles are now mostly identical - only changing in the final. --- Dockerfile | 4 +++- Dockerfile.rootless | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3a762b9..3da6f71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,9 @@ COPY *.json /var/www/html/ RUN ln -sf tinyfilemanager.php index.php -USER root CMD [ "php", "-S", "[::]:8080", "-t", "/var/www/html" ] EXPOSE 8080 + +USER root + diff --git a/Dockerfile.rootless b/Dockerfile.rootless index a77ed11..805672e 100644 --- a/Dockerfile.rootless +++ b/Dockerfile.rootless @@ -8,8 +8,6 @@ RUN echo "upload_max_filesize = 128M" >> /usr/local/etc/php/conf.d/0-upload_larg STOPSIGNAL SIGINT -ARG RUNUSER=tinyfilemanager - WORKDIR /var/www/html RUN apk add --no-cache zip libzip openssl bzip2 \ @@ -24,17 +22,21 @@ RUN apk add --no-cache zip libzip openssl bzip2 \ && apk add --virtual .phpexts-rundeps $runDeps \ && apk del .build-deps -COPY *.php /var/www/html/ -COPY *.json /var/www/html/ +COPY *.php /var/www/html/ +COPY *.json /var/www/html/ RUN ln -sf tinyfilemanager.php index.php -RUN addgroup -S $RUNUSER \ -&& adduser -S -G $RUNUSER $RUNUSER \ -&& mkdir -p /var/www/html \ -&& chown -R $RUNUSER:$RUNUSER /var/www/html - -USER $RUNUSER CMD [ "php", "-S", "[::]:8080", "-t", "/var/www/html" ] EXPOSE 8080 + +ARG RUNUSER=tinyfilemanager + +RUN addgroup -S $RUNUSER \ +&& adduser -S -G $RUNUSER $RUNUSER \ +&& mkdir -p /var/www/html \ +&& chown -R $RUNUSER:$RUNUSER /var/www/html + +USER $RUNUSER +