diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..0847788 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,50 @@ +name: release + +# Tag a commit as v* (e.g. v0.1.0) to build and publish the comfyui-nvidia +# image to the Gitea container registry. The deployed compose file +# references this image, so a successful release is what makes a new build +# reachable to deployers. + +on: + push: + tags: + - "v*" + +jobs: + build-docker: + name: Build & Push Docker Image + runs-on: ubuntu-latest + container: + image: ghcr.io/catthehacker/ubuntu:act-latest + env: + REGISTRY: git.anomalous.dev + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract version + id: version + run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + + - name: Compute image name + id: meta + run: | + owner=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') + echo "image=${{ env.REGISTRY }}/${owner}/comfyui-nvidia" >> "$GITHUB_OUTPUT" + + - name: Log in to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.TOKEN_GITEA }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + push: true + tags: | + ${{ steps.meta.outputs.image }}:${{ steps.version.outputs.version }} + ${{ steps.meta.outputs.image }}:latest diff --git a/README.md b/README.md index f17e51a..4c431e4 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,14 @@ setup. ```sh cp .env.example .env # edit .env — set OPEN_WEBUI_SECRET_KEY at minimum -docker compose up -d --build +docker compose up -d ``` +`compose up` pulls the prebuilt ComfyUI image from +`git.anomalous.dev/alphacentri/comfyui-nvidia` (CI publishes it on every +`v*` tag — see [.gitea/workflows/release.yml](.gitea/workflows/release.yml)). +Use `docker compose build` to rebuild locally when iterating on the Dockerfile. + Then drop a checkpoint into the `comfyui-models` volume and finish the Open WebUI ComfyUI configuration. Full walkthrough in [SETUP.md](SETUP.md). diff --git a/SETUP.md b/SETUP.md index d09c224..682d727 100644 --- a/SETUP.md +++ b/SETUP.md @@ -32,16 +32,27 @@ Edit `.env`: - `OPEN_WEBUI_SECRET_KEY` — generate with `openssl rand -hex 32`. Keep stable; rotating it logs every user out. -## 3. Build and start +## 3. Start the stack ```sh -docker compose up -d --build +docker compose up -d ``` -First build pulls the CUDA base, PyTorch wheels, and ComfyUI source — expect -several minutes. `docker compose logs -f comfyui` should end with a line like +This pulls the prebuilt `comfyui-nvidia` image from the Gitea registry (CI +publishes it on every `v*` tag) plus the upstream Open WebUI image, then +brings both up. `docker compose logs -f comfyui` should end with a line like `To see the GUI go to: http://0.0.0.0:8188`. +To build the image locally instead (e.g. while iterating on the Dockerfile): + +```sh +docker compose build comfyui +docker compose up -d +``` + +First local build pulls the CUDA base, PyTorch wheels, and ComfyUI source — +expect several minutes. + Health-check both services: ```sh diff --git a/docker-compose.yml b/docker-compose.yml index c1156b2..1f0e108 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,10 +25,14 @@ volumes: services: comfyui: + # CI (.gitea/workflows/release.yml) builds and pushes this image on tag. + # `build:` is kept so `docker compose build` still works locally — useful + # when iterating on the Dockerfile without going through CI. + image: git.anomalous.dev/alphacentri/comfyui-nvidia:${COMFYUI_IMAGE_TAG:-latest} + pull_policy: always build: context: . dockerfile: Dockerfile - image: comfyui-nvidia:local container_name: comfyui restart: unless-stopped networks: [comfyui-net]