From 9cf7d4d2dfd65adafb03b2301e5f0a518271b163 Mon Sep 17 00:00:00 2001 From: Martijn van der Kleijn Date: Wed, 7 Jun 2023 00:17:39 +0200 Subject: [PATCH] add example docker-compose --- .github/workflows/build-and-release.yml | 1 + README.md | 21 +++++++------ docker-compose.yml.example | 42 +++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 docker-compose.yml.example diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index c5d8691..55b0c5f 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -41,5 +41,6 @@ jobs: uses: softprops/action-gh-release@v0.1.15 with: files: ./homedash-* + append_body: true body: | The container image for this release is available from ghcr.io/mvdkleijn/homedash \ No newline at end of file diff --git a/README.md b/README.md index 1e085ad..58b4482 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,15 @@ Features include: Keep in mind that this is intended for local usage, so there are no provisions for authentication, etc. -## Support +## Usage -Supported Go versions, see: https://endoflife.date/go -Supported architectures: amd64, arm64 +1) Start HomeDash by either running the container or just starting the binary; +2) Feed your HomeDash installation using either: + - the [sidecar application](https://github.com/mvdkleijn/homedash-sidecar) or; + - the REST API, see http://localhost:8080/static/docs/ for details. +3) Go to http://localhost:8080/ to view the dashboard. (or whatever URL you host it on) -Source code and issues: https://github.com/mvdkleijn/homedash +An example docker-compose.yml file is included in the root of this git repository. The example assumes you use Traefik and something like https://github.com/tecnativa/docker-socket-proxy so adjust where needed for your situation. ## Configuration @@ -72,12 +75,12 @@ All environment variables **must** be prefixed by "HOMEDASH_". | CORS_ALLOWEDORIGINS | cors: allowedorigins: | Origins of requests allowed by CORS | "*" | | CORS_ALLOWCREDENTIALS | cors: allowcredentials: | Allow user credentials as part of request to server | false | -## Usage +## Support -1) Feed your HomeDash installation using either: - - the [sidecar application](https://github.com/mvdkleijn/homedash-sidecar) or; - - the REST API, see http://localhost:8080/static/docs/ for details. -2) Go to http://localhost:8080/ to view the dashboard. (or whatever URL you host it on) +Supported Go versions, see: https://endoflife.date/go +Supported architectures: amd64, arm64 + +Source code and issues: https://github.com/mvdkleijn/homedash ## Licensing diff --git a/docker-compose.yml.example b/docker-compose.yml.example new file mode 100644 index 0000000..5d277e5 --- /dev/null +++ b/docker-compose.yml.example @@ -0,0 +1,42 @@ +version: "3" + +networks: + traefik: + external: true + +services: + server: + image: ghcr.io/mvdkleijn/homedash:latest + container_name: homedash + environment: + - USER_UID=1000 + - USER_GID=1000 + restart: always + networks: + - traefik + labels: + - "traefik.enable=true" + - "traefik.http.routers.homedash.entrypoints=web" + - "traefik.http.routers.homedash.rule=Host(`dash.example.com`)" + - "traefik.http.services.homedash.loadbalancer.server.port=8080" + - "homedash.name=HomeDash" + - "homedash.url=https://dash.example.com" + - "homedash.icon=homedash" + + sidecar: + image: ghcr.io/mvdkleijn/homedash-sidecar:latest + container_name: homedash-sidecar + environment: + - USER_UID=1000 + - USER_GID=1000 + - HOMEDASH_SERVER=http://dash.example.com + - DOCKER_HOST=http://host.docker.internal:2375 + restart: always + network_mode: host + extra_hosts: + - "host.docker.internal:host-gateway" + labels: + - "traefik.enable=false" + depends_on: + server: + condition: service_healthy