diff --git a/README.md b/README.md index be60e60..b562a56 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ A bridge between ntfy and Alertmanager. +## Installation + +Simply use go build or the [docker image] with [docker-compose file]. + ## Configuration You can specify the configuration file location with the `--config` flag. By default @@ -20,7 +24,7 @@ Example: ``` # http listen address -http-address 127.0.0.1:8080 +http-address :8080 # Log level (either debug, info, warning, error) log-level info # Optionally protect with HTTP basic authentication @@ -75,3 +79,5 @@ Report bugs on the [issue tracker]. [priority]: https://ntfy.sh/docs/publish/#message-priority [tags]: https://ntfy.sh/docs/publish/#tags-emojis [issue tracker]: https://todo.xenrox.net/~xenrox/ntfy-alertmanager +[docker image]: https://hub.docker.com/r/xenrox/ntfy-alertmanager +[docker-compose file]: https://git.xenrox.net/~xenrox/ntfy-alertmanager/tree/master/item/docker/docker-compose.yml diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..5007d70 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,16 @@ +FROM golang:alpine as build +WORKDIR /app +ARG VERSION=0.1.0 + +RUN wget https://git.xenrox.net/~xenrox/ntfy-alertmanager/refs/download/v${VERSION}/ntfy-alertmanager-${VERSION}.tar.gz -O latest.tar.gz && \ + tar -zxf latest.tar.gz +RUN cd ntfy-alertmanager-${VERSION} && \ + go build -o /app/ntfy-alertmanager + + +FROM alpine:latest +WORKDIR / + +COPY --from=build /app/ntfy-alertmanager /ntfy-alertmanager + +ENTRYPOINT [ "./ntfy-alertmanager" ] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..5e7f683 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3" +services: + ntfy-alertmanager: + image: xenrox/ntfy-alertmanager:latest + container_name: ntfy-alertmanager + volumes: + - ./config:/etc/ntfy-alertmanager/config + ports: + - 127.0.0.1:8080:8080 + restart: unless-stopped