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 image documentation #311

Merged
merged 2 commits into from
Jan 14, 2021
Merged
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
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Options:

Open your browser on `http://yourserver:3000/wetty` and you will prompted to
login. Or go to `http://yourserver:3000/wetty/ssh/<username>` to specify the
user before hand.
user beforehand.

If you run it as root it will launch `/bin/login` (where you can specify the
user name), else it will launch `ssh` and connect by default to `localhost`. The
Expand All @@ -81,6 +81,24 @@ Check out the
[Flags docs](https://github.com/butlerx/wetty/blob/master/docs/flags.md) for a
full list of flags

### Docker container

To use wetty as a docker container, a docker image is available on
[docker hub](https://hub.docker.com/r/wettyoss/wetty). To run this image, use

```sh
docker run --rm -p 3000:3000 wettyoss/wetty --ssh-host=<YOUR-IP>
```

and you will be able to open a ssh session to the host given by `YOUR-IP` under
the URL [http://localhost:3000/wetty](http://localhost:3000/wetty).

It is recommended to drive wetty behind a reverse proxy to have HTTPS security
and possibly Let’s Encrypt support. Popular containers to achieve this are
[nginx-proxy](https://github.com/nginx-proxy/nginx-proxy) and
[traefik](https://traefik.io/traefik/). For traefik there is an example
docker-compose file in the containers directory.

## FAQ

Check out the [docs](https://github.com/butlerx/wetty/tree/master/docs)
Expand Down
35 changes: 35 additions & 0 deletions containers/docker-compose.traefik.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '2'

# Sample docker compose file to demonstrate the usage of wetty behind a reverse
# proxy, optionally with Let's Encrypt based SSL certificate
#
# For SSL support, uncomment the commented lines. Consult traefik documentation
# for features like automatic forward from HTTP to HTTPS etc.

services:
wetty:
image: wettyoss/wetty
command:
- --base=/
- --ssh-host=ssh.example.com
labels:
- "traefik.enable=true"
- "traefik.http.routers.wetty.rule=Host(`wetty.example.com`)"
# - "traefik.http.routers.wetty.tls.certResolver=default"
# - "traefik.http.routers.wetty.tls=true"

reverse-proxy:
image: traefik
command:
- --providers.docker
- --entryPoints.web.address=:80
# - --entryPoints.websecure.address=:443
# - --certificatesResolvers.default.acme.email=your-email@example.com
# - --certificatesResolvers.default.acme.storage=acme.json
# - --certificatesResolvers.default.acme.httpChallenge.entryPoint=web
ports:
- "80:80"
# - "443:443"

volumes:
- /var/run/docker.sock:/var/run/docker.sock