feat(docker): add configurable Gitea image publishing (#52)
Build and push an image from the local checkout with configurable repository and tag; configure Compose to pull that image without an upstream build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -7,6 +7,7 @@
|
|||||||
.env*
|
.env*
|
||||||
node_modules
|
node_modules
|
||||||
data
|
data
|
||||||
|
user_data
|
||||||
transcode-cache
|
transcode-cache
|
||||||
coverage
|
coverage
|
||||||
dist
|
dist
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
# - NVIDIA NVENC: Requires nvidia-container-toolkit on host + --gpus flag
|
# - NVIDIA NVENC: Requires nvidia-container-toolkit on host + --gpus flag
|
||||||
# - Intel QSV: Mount /dev/dri
|
# - Intel QSV: Mount /dev/dri
|
||||||
#
|
#
|
||||||
# Build: docker compose build
|
# Build and publish manually: ./build-push.sh [TAG]
|
||||||
# Run with VAAPI: docker run --device /dev/dri:/dev/dri --group-add video ...
|
# Run with VAAPI: docker run --device /dev/dri:/dev/dri --group-add video ...
|
||||||
|
|
||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
|
|||||||
29
README.md
29
README.md
@ -66,14 +66,36 @@ nodecast-tv is a modern, web-based IPTV player featuring Live TV, EPG, Movies (V
|
|||||||
|
|
||||||
You can run nodecast-tv easily using Docker.
|
You can run nodecast-tv easily using Docker.
|
||||||
|
|
||||||
Container images are published to `ghcr.io/technomancer702/nodecast-tv` when a GitHub release is published. Use a version tag such as `v2.2.1` for the release: stable releases publish image tags `2.2.1`, `2.2`, and `latest`; prereleases publish their full version tag without updating `latest` or the minor-version alias. Branch pushes, tag pushes alone, and draft releases do not publish images.
|
This fork uses `gitea.anthonybouteiller.ovh/blomios/nodecast-tv:latest`. Images are built and published manually from the local checkout; Compose pulls the published image and does not build from GitHub.
|
||||||
|
|
||||||
|
Before publishing, log in interactively (enter your password or personal access token at the prompt; do not put credentials in this repository):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker login gitea.anthonybouteiller.ovh --username blomios
|
||||||
|
./build-push.sh # Build this checkout and push :latest
|
||||||
|
./build-push.sh v2.2.7-local # Build and push only this tag
|
||||||
|
```
|
||||||
|
|
||||||
|
The script can be invoked by absolute path from any working directory. It requires Docker and a running Docker daemon, stops if the build fails, and performs a real push when invoked. It uses local files, including uncommitted application changes. `.dockerignore` excludes runtime data, caches, local environment files and credentials. Keep any other secrets outside the build context. Builds target the builder's platform; they do not publish a multi-platform manifest. Publishing a version tag does not also update `latest`.
|
||||||
|
|
||||||
|
Gitea's package registry must be enabled and reachable through the reverse proxy at `/v2/`. Your account must be allowed to publish packages under `blomios`. With 2FA/OAuth, use a personal access token with package read/write permissions; private image pulls also require login with package read access. Authentication, package activation and remote push have not been verified by adding this script. See the [Gitea container registry documentation](https://docs.gitea.com/usage/packages/container/).
|
||||||
|
|
||||||
|
To use another image repository or deployment tag, set `NODECAST_IMAGE` (registry/path without a tag) and `NODECAST_TAG`. Both the script and Compose support these variables; the script's positional tag takes precedence. Export them in your shell for both commands (the script does not load `.env`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export NODECAST_IMAGE=gitea.anthonybouteiller.ovh/blomios/nodecast-tv
|
||||||
|
export NODECAST_TAG=v2.2.7-local
|
||||||
|
./build-push.sh
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
1. Create a `docker-compose.yml` file (or copy the one from this repo):
|
1. Create a `docker-compose.yml` file (or copy the one from this repo):
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
nodecast-tv:
|
nodecast-tv:
|
||||||
build: https://github.com/technomancer702/nodecast-tv.git#main
|
image: ${NODECAST_IMAGE:-gitea.anthonybouteiller.ovh/blomios/nodecast-tv}:${NODECAST_TAG:-latest}
|
||||||
container_name: nodecast-tv
|
container_name: nodecast-tv
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000" # Host:Container
|
- "3000:3000" # Host:Container
|
||||||
@ -87,7 +109,8 @@ Container images are published to `ghcr.io/technomancer702/nodecast-tv` when a G
|
|||||||
|
|
||||||
2. Run the container:
|
2. Run the container:
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
docker compose pull
|
||||||
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
The application will be available at `http://localhost:3000`.
|
The application will be available at `http://localhost:3000`.
|
||||||
|
|||||||
39
build-push.sh
Executable file
39
build-push.sh
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
printf '%s\n' 'Usage: build-push.sh [TAG]' \
|
||||||
|
'Build this checkout and push it to the Gitea container registry.' \
|
||||||
|
'TAG defaults to NODECAST_TAG or latest; NODECAST_IMAGE overrides the image repository.'
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $# -eq 1 && ( $1 == --help || $1 == -h ) ]]; then
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [[ $# -gt 1 ]]; then
|
||||||
|
usage >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
repo_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||||
|
image="${NODECAST_IMAGE:-gitea.anthonybouteiller.ovh/blomios/nodecast-tv}"
|
||||||
|
tag="${1-${NODECAST_TAG:-latest}}"
|
||||||
|
if [[ ! $tag =~ ^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$ ]]; then
|
||||||
|
printf '%s\n' 'Error: Invalid Docker tag (1–128 letters, digits, underscores, dots or hyphens; cannot start with dot/hyphen).' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ $image != */* || $image == *://* || $image == *@* || $image =~ [[:space:]] || ${image##*/} == *:* ]]; then
|
||||||
|
printf '%s\n' 'Error: NODECAST_IMAGE must be a registry/repository path without a tag or digest.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! command -v docker >/dev/null 2>&1; then
|
||||||
|
printf '%s\n' 'Error: Docker is required to build and push the image.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
reference="${image}:${tag}"
|
||||||
|
printf 'Building %s from %s\n' "$reference" "$repo_dir"
|
||||||
|
docker build --file "$repo_dir/Dockerfile" --tag "$reference" "$repo_dir"
|
||||||
|
printf 'Pushing %s\n' "$reference"
|
||||||
|
docker push "$reference"
|
||||||
@ -1,7 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
nodecast-tv:
|
nodecast-tv:
|
||||||
image: ghcr.io/technomancer702/nodecast-tv:latest
|
image: ${NODECAST_IMAGE:-gitea.anthonybouteiller.ovh/blomios/nodecast-tv}:${NODECAST_TAG:-latest}
|
||||||
build: https://github.com/technomancer702/nodecast-tv.git#main
|
|
||||||
container_name: nodecast-tv
|
container_name: nodecast-tv
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
|
|||||||
Reference in New Issue
Block a user