fix deploy: use gitea:3000 for registry, retag for compose, add README.md
Some checks failed
ci/woodpecker/push/deploy Pipeline failed
ci/woodpecker/push/infra-ci Pipeline was successful
coverage 99% coverage
ci/woodpecker/push/ci Pipeline was successful

- Change buildx repo/registry from localhost:3000 to gitea:3000
  (reachable on CI network; localhost resolves to container loopback)
- Add pull+retag step in deploy so fhirworx/* compose images exist
- Copy README.md in API Dockerfile (uv build needs it from pyproject)
This commit is contained in:
kert
2026-03-22 11:20:28 -04:00
parent 2bb959a240
commit b048854afa
3 changed files with 39 additions and 31 deletions

View File

@@ -5,8 +5,8 @@
# Only runs on pushes to main (i.e. after PR merge).
#
# Image naming:
# localhost:3000/homelab/<service>:sha-<8chars> (registry)
# localhost:3000/homelab/<service>:latest (registry)
# gitea:3000/homelab/<service>:sha-<8chars> (registry)
# gitea:3000/homelab/<service>:latest (registry)
#
# The deploy step writes COMMIT_SHA=sha-<short> into .env so
# compose.yml resolves the exact image just built.
@@ -41,8 +41,8 @@ steps:
- name: build-push-notebooks
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/notebooks
registry: localhost:3000
repo: gitea:3000/homelab/notebooks
registry: gitea:3000
dockerfile: notebooks/Dockerfile
context: notebooks/
tags:
@@ -60,7 +60,7 @@ steps:
- name: scan-notebooks
image: woodpeckerci/plugin-trivy
settings:
image_ref: "localhost:3000/homelab/notebooks:sha-${CI_COMMIT_SHA:0:8}"
image_ref: "gitea:3000/homelab/notebooks:sha-${CI_COMMIT_SHA:0:8}"
severity: HIGH,CRITICAL
exit_code: 0
output: notebooks-scan.json
@@ -74,8 +74,8 @@ steps:
- name: build-push-zotero
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/zotero
registry: localhost:3000
repo: gitea:3000/homelab/zotero
registry: gitea:3000
dockerfile: zotero/Dockerfile
context: zotero/
tags:
@@ -93,7 +93,7 @@ steps:
- name: scan-zotero
image: woodpeckerci/plugin-trivy
settings:
image_ref: "localhost:3000/homelab/zotero:sha-${CI_COMMIT_SHA:0:8}"
image_ref: "gitea:3000/homelab/zotero:sha-${CI_COMMIT_SHA:0:8}"
severity: HIGH,CRITICAL
exit_code: 0
output: zotero-scan.json
@@ -116,8 +116,8 @@ steps:
- name: build-push-docs
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/docs
registry: localhost:3000
repo: gitea:3000/homelab/docs
registry: gitea:3000
dockerfile: docs/Dockerfile
context: .
tags:
@@ -137,7 +137,7 @@ steps:
- name: scan-docs
image: woodpeckerci/plugin-trivy
settings:
image_ref: "localhost:3000/homelab/docs:sha-${CI_COMMIT_SHA:0:8}"
image_ref: "gitea:3000/homelab/docs:sha-${CI_COMMIT_SHA:0:8}"
severity: HIGH,CRITICAL
exit_code: 0
output: docs-scan.json
@@ -151,8 +151,8 @@ steps:
- name: build-push-api
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/api
registry: localhost:3000
repo: gitea:3000/homelab/api
registry: gitea:3000
dockerfile: api/Dockerfile
context: .
tags:
@@ -170,7 +170,7 @@ steps:
- name: scan-api
image: woodpeckerci/plugin-trivy
settings:
image_ref: "localhost:3000/homelab/api:sha-${CI_COMMIT_SHA:0:8}"
image_ref: "gitea:3000/homelab/api:sha-${CI_COMMIT_SHA:0:8}"
severity: HIGH,CRITICAL
exit_code: 0
output: api-scan.json
@@ -184,8 +184,8 @@ steps:
- name: build-push-mc
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/mc
registry: localhost:3000
repo: gitea:3000/homelab/mc
registry: gitea:3000
dockerfile: rustfs/Dockerfile.mc
context: rustfs/
tags:
@@ -274,8 +274,12 @@ steps:
- git fetch http://gitea:3000/homelab/stack.git main
- git reset --hard FETCH_HEAD
- cp .env.bak .env 2>/dev/null || true
# Pin compose to the exact images just built
# Pull from Gitea registry and retag for compose
- TAG=sha-${CI_COMMIT_SHA:0:8}
- for SVC in notebooks zotero docs api mc; do
docker pull gitea:3000/homelab/$SVC:$TAG &&
docker tag gitea:3000/homelab/$SVC:$TAG fhirworx/$SVC:$TAG;
done
- sed -i "s/^COMMIT_SHA=.*/COMMIT_SHA=$TAG/" .env 2>/dev/null || echo "COMMIT_SHA=$TAG" >> .env
- docker compose up -d --remove-orphans
depends_on:

View File

@@ -5,8 +5,8 @@ steps:
- name: build-push-notebooks
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/notebooks
registry: localhost:3000
repo: gitea:3000/homelab/notebooks
registry: gitea:3000
dockerfile: notebooks/Dockerfile
context: notebooks/
tags:
@@ -24,8 +24,8 @@ steps:
- name: build-push-zotero
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/zotero
registry: localhost:3000
repo: gitea:3000/homelab/zotero
registry: gitea:3000
dockerfile: zotero/Dockerfile
context: zotero/
tags:
@@ -51,8 +51,8 @@ steps:
- name: build-push-docs
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/docs
registry: localhost:3000
repo: gitea:3000/homelab/docs
registry: gitea:3000
dockerfile: docs/Dockerfile
context: .
tags:
@@ -72,8 +72,8 @@ steps:
- name: build-push-api
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/api
registry: localhost:3000
repo: gitea:3000/homelab/api
registry: gitea:3000
dockerfile: api/Dockerfile
context: .
tags:
@@ -91,8 +91,8 @@ steps:
- name: build-push-mc
image: woodpeckerci/plugin-docker-buildx
settings:
repo: localhost:3000/homelab/mc
registry: localhost:3000
repo: gitea:3000/homelab/mc
registry: gitea:3000
dockerfile: rustfs/Dockerfile.mc
context: rustfs/
tags:
@@ -110,7 +110,7 @@ steps:
- name: scan-notebooks
image: woodpeckerci/plugin-trivy
settings:
image_ref: "localhost:3000/homelab/notebooks:sha-${CI_COMMIT_SHA:0:8}"
image_ref: "gitea:3000/homelab/notebooks:sha-${CI_COMMIT_SHA:0:8}"
severity: HIGH,CRITICAL
exit_code: 0
volumes:
@@ -121,7 +121,7 @@ steps:
- name: scan-zotero
image: woodpeckerci/plugin-trivy
settings:
image_ref: "localhost:3000/homelab/zotero:sha-${CI_COMMIT_SHA:0:8}"
image_ref: "gitea:3000/homelab/zotero:sha-${CI_COMMIT_SHA:0:8}"
severity: HIGH,CRITICAL
exit_code: 0
volumes:
@@ -132,7 +132,7 @@ steps:
- name: scan-api
image: woodpeckerci/plugin-trivy
settings:
image_ref: "localhost:3000/homelab/api:sha-${CI_COMMIT_SHA:0:8}"
image_ref: "gitea:3000/homelab/api:sha-${CI_COMMIT_SHA:0:8}"
severity: HIGH,CRITICAL
exit_code: 0
volumes:
@@ -148,6 +148,10 @@ steps:
commands:
- cd /home/kert/stack
- TAG=sha-${CI_COMMIT_SHA:0:8}
- for SVC in notebooks zotero docs api mc; do
docker pull gitea:3000/homelab/$SVC:$TAG &&
docker tag gitea:3000/homelab/$SVC:$TAG fhirworx/$SVC:$TAG;
done
- sed -i "s/^COMMIT_SHA=.*/COMMIT_SHA=$TAG/" .env 2>/dev/null || echo "COMMIT_SHA=$TAG" >> .env
- docker compose up -d --remove-orphans
depends_on:

View File

@@ -4,7 +4,7 @@ FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
WORKDIR /app
# Copy project files for install
COPY pyproject.toml uv.lock ./
COPY pyproject.toml uv.lock README.md ./
COPY src/ src/
# Install the package (no dev deps)