From 090b215179a5b3de4e41e6700b1d379e6f5629b6 Mon Sep 17 00:00:00 2001 From: kanadaj Date: Sun, 13 Jun 2021 23:51:16 +0100 Subject: [PATCH 1/2] Update Dockerfile --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index c07adc28..9858d54b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,4 +78,9 @@ COPY docker/docker-entrypoint.sh docker-entrypoint.sh COPY docker/config/shlink_in_docker.local.php config/autoload/shlink_in_docker.local.php COPY docker/config/php.ini ${PHP_INI_DIR}/conf.d/ +# Change the ownership of /etc/shlink/data to be writable, then change the user to non-root +RUN chown 1001 -R /etc/shlink/data + +USER 1001 + ENTRYPOINT ["/bin/sh", "./docker-entrypoint.sh"] From 2b97f9ac9ee5809212113dfb8987958ae7bc5037 Mon Sep 17 00:00:00 2001 From: kanadaj Date: Sun, 13 Jun 2021 23:54:35 +0100 Subject: [PATCH 2/2] Update Dockerfile Security update --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9858d54b..e327c092 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,7 +79,11 @@ COPY docker/config/shlink_in_docker.local.php config/autoload/shlink_in_docker.l COPY docker/config/php.ini ${PHP_INI_DIR}/conf.d/ # Change the ownership of /etc/shlink/data to be writable, then change the user to non-root -RUN chown 1001 -R /etc/shlink/data +RUN chown 1001 /etc/shlink/data +RUN chown 1001 /etc/shlink/data/locks +RUN chown 1001 /etc/shlink/data/proxies +RUN chown 1001 /etc/shlink/data/cache +RUN chown 1001 /etc/shlink/data/log USER 1001