From 6c8f9ceb631c2fb3d9ed88b912f621d5f8120c34 Mon Sep 17 00:00:00 2001 From: aiulian25 Date: Wed, 17 Dec 2025 01:03:57 +0000 Subject: [PATCH] Initial commit: StreamFlow IPTV platform with Docker Hub deployment --- .github/workflows/docker-publish.yml | 61 ++++++++ DOCKER_HUB_DEPLOYMENT.md | 208 +++++++++++++++++++++++++ DOCKER_INSTALLATION.md | 221 +++++++++++++++++++++++++++ PUBLISHING_STEPS.md | 177 +++++++++++++++++++++ docker-compose.yml | 2 +- publish-docker.sh | 68 +++++++++ 6 files changed, 736 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker-publish.yml create mode 100644 DOCKER_HUB_DEPLOYMENT.md create mode 100644 DOCKER_INSTALLATION.md create mode 100644 PUBLISHING_STEPS.md create mode 100755 publish-docker.sh diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..0dddda0 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,61 @@ +name: Build and Push to Docker Hub + +on: + push: + branches: + - main + tags: + - 'v*' + workflow_dispatch: # Allow manual trigger + +env: + DOCKER_USERNAME: aiulian25 + IMAGE_NAME: streamflow + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Update Docker Hub description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + repository: ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }} + short-description: "StreamFlow - IPTV streaming platform with VPN support" + readme-filepath: ./DOCKER_INSTALLATION.md diff --git a/DOCKER_HUB_DEPLOYMENT.md b/DOCKER_HUB_DEPLOYMENT.md new file mode 100644 index 0000000..7b50c91 --- /dev/null +++ b/DOCKER_HUB_DEPLOYMENT.md @@ -0,0 +1,208 @@ +# Docker Hub Deployment Guide + +This guide will help you publish the StreamFlow Docker image to Docker Hub so users can easily deploy it. + +## Prerequisites + +1. Docker Hub account (create one at https://hub.docker.com) +2. Docker installed and running locally + +## Step 1: Login to Docker Hub + +```bash +docker login +``` + +Enter your Docker Hub username and password when prompted. + +## Step 2: Build the Docker Image + +Build the image with your Docker Hub username: + +```bash +docker build -t aiulian25/streamflow:latest . +``` + +You can also create version tags: + +```bash +docker build -t aiulian25/streamflow:latest -t aiulian25/streamflow:v1.0.0 . +``` + +## Step 3: Push to Docker Hub + +Push the image to Docker Hub: + +```bash +docker push aiulian25/streamflow:latest +``` + +If you created version tags, push them too: + +```bash +docker push aiulian25/streamflow:v1.0.0 +``` + +## Step 4: Verify on Docker Hub + +Visit https://hub.docker.com/r/aiulian25/streamflow to verify your image is published. + +## Automated Build (Optional) + +You can set up GitHub Actions to automatically build and push images: + +### Create `.github/workflows/docker-publish.yml`: + +```yaml +name: Build and Push Docker Image + +on: + push: + branches: + - main + tags: + - 'v*' + pull_request: + branches: + - main + +env: + DOCKER_HUB_USERNAME: aiulian25 + IMAGE_NAME: streamflow + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + +``` + +### Add Docker Hub Secrets to GitHub: + +1. Go to your repository: https://github.com/aiulian25/streamflow +2. Navigate to **Settings** → **Secrets and variables** → **Actions** +3. Add the following secrets: + - `DOCKER_HUB_USERNAME`: Your Docker Hub username (aiulian25) + - `DOCKER_HUB_TOKEN`: Create a token at https://hub.docker.com/settings/security + +## Usage for End Users + +After publishing, users can simply run: + +```bash +# Download the docker-compose.yml +wget https://raw.githubusercontent.com/aiulian25/streamflow/main/docker-compose.yml + +# Create environment file (optional) +cat > .env < .env <` + +3. **Push to GitHub:** + ```bash + git add . + git commit -m "Configure Docker Hub deployment" + git push origin main + ``` + +4. **Automatic builds will now run on:** + - Every push to `main` branch → builds `latest` tag + - Every git tag (e.g., `v1.0.0`) → builds version tag + +## For Your Users + +After publishing, users can install StreamFlow in 3 simple commands: + +```bash +# 1. Download docker-compose.yml +wget https://raw.githubusercontent.com/aiulian25/streamflow/main/docker-compose.yml + +# 2. (Optional) Create environment file +cat > .env < + +# Clean up test +docker stop +docker rm +``` + +## Maintenance + +### Publishing a New Version + +```bash +# Tag your release +git tag -a v1.0.1 -m "Release v1.0.1" +git push origin v1.0.1 + +# Or manually: +./publish-docker.sh v1.0.1 +``` + +### Users Update to Latest Version + +```bash +docker compose pull +docker compose up -d +``` + +## Files Created + +1. **DOCKER_HUB_DEPLOYMENT.md** - Complete deployment guide for you +2. **DOCKER_INSTALLATION.md** - User-friendly installation guide +3. **publish-docker.sh** - Automated build and push script +4. **.github/workflows/docker-publish.yml** - GitHub Actions workflow +5. **docker-compose.yml** - Updated to use Docker Hub image + +## Multi-Architecture Support (Optional) + +To support both AMD64 and ARM64 (Raspberry Pi, Apple Silicon): + +```bash +# Create builder +docker buildx create --name mybuilder --use + +# Build for multiple platforms +docker buildx build --platform linux/amd64,linux/arm64 \ + -t aiulian25/streamflow:latest \ + --push . +``` + +GitHub Actions workflow already supports multi-arch builds! + +## Summary + +Your StreamFlow application is now ready for easy deployment! Users will be able to: + +1. Download one file (`docker-compose.yml`) +2. Run `docker compose up -d` +3. Access the application instantly + +No complex builds, no dependencies, just pull and run! 🎉 diff --git a/docker-compose.yml b/docker-compose.yml index 15a5b8e..b329212 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ services: streamflow: - image: ghcr.io/aiulian25/streamflow-iptv:latest + image: aiulian25/streamflow:latest container_name: streamflow restart: unless-stopped ports: diff --git a/publish-docker.sh b/publish-docker.sh new file mode 100755 index 0000000..e4ea121 --- /dev/null +++ b/publish-docker.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# StreamFlow Docker Hub Publishing Script +# This script builds and pushes the Docker image to Docker Hub + +set -e # Exit on error + +# Configuration +DOCKER_USERNAME="aiulian25" +IMAGE_NAME="streamflow" +VERSION="${1:-latest}" # Use argument or default to 'latest' + +echo "=========================================" +echo " StreamFlow Docker Hub Publisher" +echo "=========================================" +echo "" +echo "Username: $DOCKER_USERNAME" +echo "Image: $IMAGE_NAME" +echo "Version: $VERSION" +echo "" + +# Check if Docker is running +if ! docker info > /dev/null 2>&1; then + echo "❌ Error: Docker is not running" + exit 1 +fi + +# Check if logged in to Docker Hub +if ! docker info | grep -q "Username"; then + echo "⚠️ Not logged in to Docker Hub" + echo "Please run: docker login" + exit 1 +fi + +echo "📦 Building Docker image..." +echo "" + +# Build the image +docker build -t "${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}" . + +# If version is not 'latest', also tag as latest +if [ "$VERSION" != "latest" ]; then + echo "" + echo "🏷️ Tagging as latest..." + docker tag "${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}" "${DOCKER_USERNAME}/${IMAGE_NAME}:latest" +fi + +echo "" +echo "⬆️ Pushing to Docker Hub..." +echo "" + +# Push the version tag +docker push "${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}" + +# Push latest tag if we created it +if [ "$VERSION" != "latest" ]; then + docker push "${DOCKER_USERNAME}/${IMAGE_NAME}:latest" +fi + +echo "" +echo "✅ Successfully published!" +echo "" +echo "📍 Image URL: https://hub.docker.com/r/${DOCKER_USERNAME}/${IMAGE_NAME}" +echo "🐳 Pull command: docker pull ${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}" +echo "" +echo "Users can now run:" +echo " docker compose up -d" +echo ""