From 8c45e9a0ad54be9578932fd20043278975ee8372 Mon Sep 17 00:00:00 2001 From: Silvio Ankermann Date: Tue, 18 Jan 2022 01:41:09 +0100 Subject: [PATCH] Switch container image to nginx-unprivileged Signed-off-by: Silvio Ankermann --- Dockerfile | 4 +--- README.md | 4 ++-- docs/kubernetes.md | 4 ++-- nginx/conf.d/default.conf | 6 +++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index d33e1d8458a..67ea74b50fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN dos2unix /src/scripts/docker-package.sh && bash /src/scripts/docker-package. RUN cp /src/config.sample.json /src/webapp/config.json # App -FROM nginx:alpine +FROM nginxinc/nginx-unprivileged:stable-alpine COPY --from=builder /src/webapp /app @@ -33,5 +33,3 @@ RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types # Override default nginx config COPY /nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf -RUN rm -rf /usr/share/nginx/html \ - && ln -s /app /usr/share/nginx/html diff --git a/README.md b/README.md index 2c1a4a18f91..b3e598ed25d 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ The Docker image can be used to serve element-web as a web server. The easiest w it is to use the prebuilt image: ```bash -docker run -p 80:80 vectorim/element-web +docker run -p 80:8080 vectorim/element-web ``` To supply your own custom `config.json`, map a volume to `/app/config.json`. For example, @@ -182,7 +182,7 @@ if your custom config was located at `/etc/element-web/config.json` then your Do would be: ```bash -docker run -p 80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web +docker run -p 80:8080 -v /etc/element-web/config.json:/app/config.json vectorim/element-web ``` To build the image yourself: diff --git a/docs/kubernetes.md b/docs/kubernetes.md index 34cb6450700..3ca04ec9095 100644 --- a/docs/kubernetes.md +++ b/docs/kubernetes.md @@ -116,7 +116,7 @@ Then you can deploy it to your cluster with something like `kubectl apply -f my- mountPath: /app/config.json subPath: config.json ports: - - containerPort: 80 + - containerPort: 8080 name: element protocol: TCP readinessProbe: @@ -152,7 +152,7 @@ Then you can deploy it to your cluster with something like `kubectl apply -f my- - name: default protocol: TCP port: 80 - targetPort: 80 + targetPort: 8080 --- diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index 04b1e8ac6aa..fa9a097468f 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -1,9 +1,9 @@ server { - listen 80; - listen [::]:80; + listen 8080; + listen [::]:8080; server_name localhost; - root /usr/share/nginx/html; + root /app; index index.html; # Set no-cache for the index.html only so that browsers always check for a new copy of Element Web.