make wanted changes

Signed-off-by: Ivan Schaller <ivan@schaller.sh>
This commit is contained in:
Ivan Schaller
2023-04-17 17:06:42 +02:00
parent ff7fdf4350
commit a112241c76
5 changed files with 47 additions and 70 deletions

View File

@@ -1,6 +1,19 @@
# Examples
> The default container user has uid 65534.
## docker-simple
An example how to setup endlessh-go, Prometheus, and Grafana using [docker compose](https://docs.docker.com/compose/).
## docker-maxmind
An example how to setup endlessh-go with the Maxmind GeoIP Database.
### Using privileged ports (<1024) on docker
If you want to run the image with privileged ports (below 1025), you need to set the container user to root:
```yml
user: root
```

View File

@@ -0,0 +1,16 @@
## docker compose
This is an example how to setup endlessh-go with the Maxmind GeoIP Database using [docker compose](https://docs.docker.com/compose/). The reference of the compose file can be found [here](https://docs.docker.com/compose/compose-file/).
To start the stack, in the _examples_ folder, run:
```
sudo docker-compose up -d
```
The GeoIP Database will be saved in a mounted volume in: `./geo-data`. And the endlessh-go container will use this database to do the location lookups.
This example exposes the following ports. Except the SSH port, you should not expose other ports to public without protections (not included in this example) in production.
- **2222**: The SSH port. You may test endlessh-go by running `ssh -p 2222 localhost`. Your SSH client should hang. View the log of endlessh-go by running `sudo docker logs endlessh`.
- **2112**: The Prometheus metrics exported by endlessh-go. Go to [http://localhost:2112/metrics](http://localhost:2112/metrics) in your web browser to view the metrics.