From 3aec978570682bfc0a48c8cb7e70346bd9b683e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxi=20Quo=C3=9F?= Date: Wed, 22 Feb 2023 16:30:01 +0100 Subject: [PATCH] docker-compose: make port change more clear #54 --- README.md | 17 ++++++++++++++++- docker-compose.yml | 9 +++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c7ad24b..41c1bc21 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,22 @@ If you need network discovery, make sure to have `nmap` installed and run upsnap Alternatively use the [docker-compose](docker-compose.yml) example. See the comments in the file for customization. -If you need additional packages inside the container, uncomment the `entrypoint` inside the compose file. You can search for your needed package [here](https://pkgs.alpinelinux.org/packages). +If you want to change the port, change the following (5000 in this case): + +```yml +entrypoint: /bin/sh -c "./upsnap serve --http 0.0.0.0:5000" +healthcheck: + test: curl -fs "http://localhost:5000/api/health" || exit 1 + interval: 10s +``` + +And if you need additional packages inside the container, do this: + +```yml +entrypoint: /bin/sh -c "apk update && apk add --no-cache && rm -rf /var/cache/apk/* && ./upsnap serve --http 0.0.0.0:8090" +``` + +You can search for your needed package [here](https://pkgs.alpinelinux.org/packages). ### Reverse Proxy diff --git a/docker-compose.yml b/docker-compose.yml index 507f7eac..e5c3efcd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,5 +12,10 @@ services: # - UPSNAP_INTERVAL=@every 10s # Sets the interval in which the devices are pinged # - UPSNAP_SCAN_RANGE=192.168.1.0/24 # Scan range is used for device discovery on local network # - UPSNAP_WEBSITE_TITLE=Custom name # Custom website title - # # you can change the listen ip:port inside the container or install custom packages for shutdown via a custom entrypoint - # entrypoint: /bin/sh -c "apk update && apk add --no-cache ipmitool && rm -rf /var/cache/apk/* && ./upsnap serve --http 0.0.0.0:8090" + # you can change the listen ip:port inside the container like this: + # entrypoint: /bin/sh -c "./upsnap serve --http 0.0.0.0:5000" + # healthcheck: + # test: curl -fs "http://localhost:5000/api/health" || exit 1 + # interval: 10s + # # or install custom packages for shutdown + # entrypoint: /bin/sh -c "apk update && apk add --no-cache && rm -rf /var/cache/apk/* && ./upsnap serve --http 0.0.0.0:8090"