diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..5b7b555 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI for GHCR + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build_and_publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build and publish the Docker image to GHCR + run: | + docker login --username raycadle --password ${{ secrets.GH_PAT }} ghcr.io + docker build --build-arg BUILD_DATE="$(date +%d/%m/%y)" --build-arg VERSION="$(date +%R:%S)" --tag ghcr.io/raycadle/ntfy:latest . + docker push ghcr.io/raycadle/ntfy:latest diff --git a/README.md b/README.md index e011b82..950bfc4 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,43 @@ -# Docker Ntfy +![ntfy](https://github.com/binwiederhier/ntfy/raw/main/web/public/static/images/ntfy.png) -[Ntfy](https://ntfy.sh/) A free and open source notification service. +# ntfy.sh | Send push notifications to your phone or desktop via PUT/POST -This is a Ntfy Docker image built on top of linuxserver.io's `baseimage-alpine:3.18` image, but is not supported by linuxserver.io. +**[ntfy](https://ntfy.sh/)** (pronounced *"notify"*) is a simple HTTP-based pub-sub notification service. -## The official docker image can be found at https://hub.docker.com/r/binwiederhier/ntfy +This is an unofficial Docker image built using the [LinuxServer](https://www.linuxserver.io/) team's [Alpine base-image](https://github.com/linuxserver/docker-baseimage-alpine). + +## Notice +Although using both [binwiederhier's](https://github.com/binwiederhier) and [LinuxServer's](https://www.linuxserver.io/) respective works at its core, this image is not associated with — nor endorsed by — either developers in any way, shape, or form. It is simply a project for me to learn container architecture, which I chose to make public in the spirit of [FOSS](https://en.wikipedia.org/wiki/Free_and_open-source_software). All rights belong to their respective owners. + +The official ntfy Docker image can be found [here](https://hub.docker.com/r/binwiederhier/ntfy) and you can support its developer [here](https://github.com/sponsors/binwiederhier) and [here](https://en.liberapay.com/ntfy/), or contribute to its development [here](https://github.com/binwiederhier/ntfy). ## Usage +To use this image, simply run the following command: +```shell +docker run -p 8080:8080 ghcr.io/raycadle/ntfy:latest +``` +or +```shell +podman run -p 8080:8080 ghcr.io/raycadle/ntfy:latest +``` -This image must be built and ran with the docker/podman cli. +## Build +If you wish to build this image locally, you can do so by running the commands below. -### Docker CLI +### Clone Repo +```shell +git clone https://github.com/raycadle/docker-ntfy.git && cd docker-ntfy ``` -docker build -t ntfy:latest . && \ -docker create \ +### Build & Run +```shell +docker build --build-arg BUILD_DATE="$(date +%d/%m/%y)" --build-arg VERSION="$(date +%R:%S)" --tag ntfy:latest . && \ +docker run \ --name=ntfy \ -e PUID=1000 \ -e PGID=1000 \ - -e TZ=Europe/London \ + -e TZ=America/Belize \ -p 8080:8080 \ - -v path_to_data:/config \ + -v /path/to/data:/config \ --restart unless-stopped \ ntfy:latest ```