Skip to content

Commit

Permalink
Specify a local address when exposing ports with Docker (#20891)
Browse files Browse the repository at this point in the history
* Specify a local address when exposing ports with Docker

cf. https://docs.docker.com/engine/reference/commandline/run/#publish-or-expose-port--p---expose

Signed-off-by: Richard Gibson <[email protected]>

* Provide and explain docker run examples with and without confinement to localhost

Signed-off-by: Richard Gibson <[email protected]>

* Update README.md

Co-authored-by: Richard Gibson <[email protected]>

---------

Signed-off-by: Richard Gibson <[email protected]>
Co-authored-by: Michael Telatynski <[email protected]>
  • Loading branch information
gibson042 and t3chguy authored Nov 1, 2024
1 parent a27dfa1 commit b8fd98a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,23 @@ 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 --rm -p 127.0.0.1:80:80 vectorim/element-web
```

A server can also be made available to clients outside the local host by omitting the
explicit local address as described in
[docker run documentation](https://docs.docker.com/engine/reference/commandline/run/#publish-or-expose-port--p---expose):

```bash
docker run --rm -p 80:80 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 --rm -p 127.0.0.1:80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web
```

To build the image yourself:
Expand Down

0 comments on commit b8fd98a

Please sign in to comment.