From b6569eb81e94c81568eaab4979e9fbce53471366 Mon Sep 17 00:00:00 2001 From: blomios Date: Tue, 29 Sep 2026 23:34:11 +0200 Subject: [PATCH] chore: add Docker build/push script targeting Gitea registry and use published image in README --- README.md | 4 +++- scripts/docker-build-push.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 scripts/docker-build-push.sh diff --git a/README.md b/README.md index 19dfcdf..5ea5686 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ You can run nodecast-tv easily using Docker. ```yaml services: nodecast-tv: - build: https://github.com/technomancer702/nodecast-tv.git#main + image: gitea.anthonybouteiller.ovh/blomios/nodecast-tv:latest container_name: nodecast-tv ports: - "3000:3000" # Host:Container @@ -90,6 +90,8 @@ You can run nodecast-tv easily using Docker. The application will be available at `http://localhost:3000`. +To publish the image, log in if needed with `docker login gitea.anthonybouteiller.ovh`, then run `./scripts/docker-build-push.sh`. Use `--no-push` to build it locally without publishing. + ### Hardware Acceleration Setup diff --git a/scripts/docker-build-push.sh b/scripts/docker-build-push.sh new file mode 100755 index 0000000..1df4070 --- /dev/null +++ b/scripts/docker-build-push.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +set -euo pipefail + +REGISTRY=${REGISTRY:-gitea.anthonybouteiller.ovh} +OWNER=${OWNER:-blomios} +IMAGE_NAME=${IMAGE_NAME:-nodecast-tv} +TAG=${TAG:-latest} +IMAGE="${REGISTRY}/${OWNER}/${IMAGE_NAME}:${TAG}" + +push_image=true +if [[ "${1:-}" == "--no-push" ]]; then + push_image=false +elif [[ $# -gt 0 ]]; then + echo "Usage: $0 [--no-push]" >&2 + exit 2 +fi + +if ! command -v docker >/dev/null 2>&1; then + echo "Error: docker is required but was not found in PATH." >&2 + exit 1 +fi + +repo_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) + +echo "Target image: ${IMAGE}" +docker build --file "${repo_dir}/Dockerfile" --tag "${IMAGE}" "${repo_dir}" + +if [[ "${DRY_RUN:-false}" == "true" || "${push_image}" == "false" ]]; then + echo "Push skipped." + exit 0 +fi + +docker push "${IMAGE}"