From 7eae695a788a122f50ad5f478a8da7ae6d9731f3 Mon Sep 17 00:00:00 2001 From: Alexander Schaber Date: Fri, 22 Sep 2023 14:54:56 +0200 Subject: [PATCH] build!: switch nginx docker base image to unprivileged version --- Dockerfile | 5 ++++- README.md | 2 +- config/docker/nginx.conf | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 91842ba2..7b807e97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,12 @@ ARG VERSION="latest" ENV VERSION ${VERSION} RUN cd /shlink-web-client && npm ci && npm run build -FROM nginx:1.25-alpine +FROM nginxinc/nginx-unprivileged:1.25-alpine +ARG UID=101 LABEL maintainer="Alejandro Celaya " +USER root RUN rm -r /usr/share/nginx/html && rm /etc/nginx/conf.d/default.conf +USER $UID COPY config/docker/nginx.conf /etc/nginx/conf.d/default.conf COPY scripts/docker/servers_from_env.sh /docker-entrypoint.d/30-shlink-servers-json.sh COPY --from=node /shlink-web-client/build /usr/share/nginx/html diff --git a/README.md b/README.md index b2af0799..040c418e 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Those servers can be exported and imported in other browsers, but if for some re If you are using the shlink-web-client docker image, you can mount the `servers.json` file in a volume inside `/usr/share/nginx/html`, which is the app's document root inside the container. - docker run --name shlink-web-client -p 8000:80 -v ${PWD}/servers.json:/usr/share/nginx/html/servers.json shlinkio/shlink-web-client + docker run --name shlink-web-client -p 8000:8080 -v ${PWD}/servers.json:/usr/share/nginx/html/servers.json shlinkio/shlink-web-client Alternatively, you can mount a `conf.d` directory, which in turn contains the `servers.json` file, in a volume inside `/usr/share/nginx/html`. *(since shlink-web-client 3.2.0)*. diff --git a/config/docker/nginx.conf b/config/docker/nginx.conf index cee606bb..038768a3 100644 --- a/config/docker/nginx.conf +++ b/config/docker/nginx.conf @@ -1,5 +1,5 @@ server { - listen 80 default_server; + listen 8080 default_server; charset utf-8; root /usr/share/nginx/html; index index.html;