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

Docker: allow configuration of HTTP listen port via env var #28840

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ FROM nginx:alpine-slim

COPY --from=builder /src/webapp /app

# Override default nginx config
COPY /nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
# Override default nginx config. Templates in `/etc/nginx/templates` are passed
# through `envsubst` by the nginx docker image entry point.
COPY /docker/nginx-templates/* /etc/nginx/templates/

RUN rm -rf /usr/share/nginx/html \
&& ln -s /app /usr/share/nginx/html

# HTTP listen port
ENV ELEMENT_WEB_PORT=80
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server {
listen 80;
listen [::]:80;
listen ${ELEMENT_WEB_PORT};
listen [::]:${ELEMENT_WEB_PORT};
server_name localhost;

root /usr/share/nginx/html;
Expand Down
10 changes: 10 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ would be:
docker run --rm -p 127.0.0.1:80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web
```

The behaviour of the dockker image can be customised via the following
richvdh marked this conversation as resolved.
Show resolved Hide resolved
environment variables:

* `ELEMENT_WEB_PORT`

The port to listen on (within the docker container) for HTTP
traffic. Defaults to `80`.

### Building the docker image

To build the image yourself:

```bash
Expand Down
Loading