From e191b32888c85d48c6da7926b887bbccbd2b69c8 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 10 Feb 2026 00:14:05 +0000 Subject: [PATCH] fix: Dockerfile and CI for multi-repo deployment - Fix requirements.txt path to shared_lib/requirements.txt - CI: add git submodule update, deploy shared coop stack from /root/coop Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/ci.yml | 12 ++++++++---- Dockerfile | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 00aaf8d..e1038f6 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -7,6 +7,7 @@ on: env: REGISTRY: registry.rose-ash.com:5000 IMAGE: events + REPO_DIR: /root/events jobs: build-and-deploy: @@ -33,9 +34,10 @@ jobs: DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} run: | ssh "root@$DEPLOY_HOST" " - cd /root/events + cd ${{ env.REPO_DIR }} git fetch origin main git reset --hard origin/main + git submodule update --init --recursive " - name: Build and push image @@ -43,8 +45,10 @@ jobs: DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} run: | ssh "root@$DEPLOY_HOST" " - cd /root/events - docker build --build-arg CACHEBUST=\$(date +%s) -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }} . + cd ${{ env.REPO_DIR }} + docker build --build-arg CACHEBUST=\$(date +%s) \ + -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest \ + -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }} . docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }} " @@ -54,7 +58,7 @@ jobs: DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} run: | ssh "root@$DEPLOY_HOST" " - cd /root/events + cd /root/coop source .env docker stack deploy -c docker-compose.yml coop echo 'Waiting for services to update...' diff --git a/Dockerfile b/Dockerfile index b5ff8d0..1cc07b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ postgresql-client \ && rm -rf /var/lib/apt/lists/* -COPY requirements.txt ./requirements.txt +COPY shared_lib/requirements.txt ./requirements.txt RUN pip install -r requirements.txt COPY . .