Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch container image to nginx-unprivileged #20627

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ 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,
if your custom config was located at `/etc/element-web/config.json` then your Docker command
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:
Expand Down
4 changes: 2 additions & 2 deletions docs/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

---

Expand Down
6 changes: 3 additions & 3 deletions nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Loading