chore: add Docker build/push script targeting Gitea registry and use published image in README
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
34
scripts/docker-build-push.sh
Executable file
34
scripts/docker-build-push.sh
Executable file
@ -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}"
|
||||
Reference in New Issue
Block a user