From 2d593dc64edc7407ee8a3fa7d77bd35de57915b8 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Mon, 24 Mar 2025 09:46:08 -0500 Subject: [PATCH] Added support for Forks. --- .github/workflows/docker-build.yml | 1 + docker/Dockerfile | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 46f7ee8b..6ac6278f 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -50,6 +50,7 @@ jobs: platforms: linux/amd64,linux/arm64 build-args: | BRANCH=${{ env.BRANCH }} + REPO_URL=https://github.com/${{ github.repository }} tags: | ghcr.io/${{ env.REPO_NAME }}:${{ env.TAG }} ghcr.io/${{ env.REPO_NAME }}:${{ github.sha }} diff --git a/docker/Dockerfile b/docker/Dockerfile index b833a9f7..fd910759 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,10 @@ FROM python:3.13-slim AS builder -# Define build argument with default value of "main" +# Define build arguments with default values ARG BRANCH=main +# This will be overridden by the GitHub Actions workflow +# when building the Docker image for production. +ARG REPO_URL=https://github.com/Dispatcharr/Dispatcharr ENV PATH="/dispatcharrpy/bin:$PATH" \ VIRTUAL_ENV=/dispatcharrpy \ @@ -27,7 +30,7 @@ RUN apt-get update && \ nodejs && \ python -m pip install virtualenv && \ virtualenv /dispatcharrpy && \ - git clone -b ${BRANCH} https://github.com/Dispatcharr/Dispatcharr /app && \ + git clone -b ${BRANCH} ${REPO_URL} /app && \ cd /app && \ rm -rf .git && \ cd /app && \