From c012226a6455f0f11f726ce355c940a8345c079c Mon Sep 17 00:00:00 2001 From: Wuesteon Date: Thu, 27 Nov 2025 18:59:48 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20fix(docker):=20remove=20deprecat?= =?UTF-8?q?ed=20mana-core-nestjs-package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove all git cloning and tarball packaging logic for mana-core-nestjs-package. Package is no longer needed - logic moved to mana-core service. Changes: - Remove git clone with token mounting - Remove tarball creation steps - Remove sed replacement of GitHub URLs - Simplify build dependencies (no git/openssh needed) Fixes Docker build failures in maerchenzauber and manadeck backends --- apps/maerchenzauber/apps/backend/Dockerfile | 38 ++------------------- apps/manadeck/apps/backend/Dockerfile | 38 ++------------------- 2 files changed, 4 insertions(+), 72 deletions(-) diff --git a/apps/maerchenzauber/apps/backend/Dockerfile b/apps/maerchenzauber/apps/backend/Dockerfile index 0994e1597..1007feeba 100644 --- a/apps/maerchenzauber/apps/backend/Dockerfile +++ b/apps/maerchenzauber/apps/backend/Dockerfile @@ -6,48 +6,14 @@ FROM node:20-alpine AS builder WORKDIR /app # Install build dependencies -RUN apk add --no-cache python3 make g++ git openssh-client - -# Configure git to use HTTPS with token -RUN git config --global url."https://github.com/".insteadOf "git@github.com:" && \ - git config --global url."https://".insteadOf "git://" - -# Clone, build and package mana-core as a tarball -RUN --mount=type=secret,id=github_token \ - if [ -f /run/secrets/github_token ]; then \ - export GITHUB_TOKEN=$(cat /run/secrets/github_token) && \ - echo "Using GitHub token for private repo access" && \ - git clone https://${GITHUB_TOKEN}@github.com/Memo-2023/mana-core-nestjs-package.git /tmp/mana-core; \ - else \ - echo "No GitHub token provided, attempting public clone" && \ - git clone https://github.com/Memo-2023/mana-core-nestjs-package.git /tmp/mana-core; \ - fi && \ - cd /tmp/mana-core && \ - npm install --force && \ - npm run build && \ - npm pack && \ - mv *.tgz /app/mana-core.tgz && \ - echo "Mana-core packaged as tarball at /app/mana-core.tgz" +RUN apk add --no-cache python3 make g++ # Copy backend package.json COPY apps/maerchenzauber/apps/backend/package.json ./backend/package.json -# Replace GitHub URL with the tarball (../ because package.json is in backend/) -RUN sed -i 's|"git+https://github.com/Memo-2023/mana-core-nestjs-package.git"|"file:../mana-core.tgz"|g' backend/package.json || \ - sed -i 's|"github:Memo-2023/mana-core-nestjs-package"|"file:../mana-core.tgz"|g' backend/package.json - -# Debug: Verify the replacement and file existence -RUN echo "=== Verifying tarball and package.json ===" && \ - ls -la mana-core.tgz && \ - echo "Tarball exists at /app/mana-core.tgz" && \ - echo "Checking package.json replacement:" && \ - grep -n "mana-core" backend/package.json && \ - echo "=== End verification ===" - # Install backend dependencies WORKDIR /app/backend -RUN npm install --legacy-peer-deps && \ - echo "Dependencies installed with mana-core from tarball" +RUN npm install --legacy-peer-deps # Copy shared packages source code and build them if they exist WORKDIR /app diff --git a/apps/manadeck/apps/backend/Dockerfile b/apps/manadeck/apps/backend/Dockerfile index 89b669bce..156de2265 100644 --- a/apps/manadeck/apps/backend/Dockerfile +++ b/apps/manadeck/apps/backend/Dockerfile @@ -5,47 +5,13 @@ FROM node:18-alpine AS builder WORKDIR /app # Install build dependencies -RUN apk add --no-cache python3 make g++ git openssh-client - -# Configure git to use HTTPS with token -RUN git config --global url."https://github.com/".insteadOf "git@github.com:" && \ - git config --global url."https://".insteadOf "git://" - -# Clone, build and package mana-core as a tarball -RUN --mount=type=secret,id=github_token \ - if [ -f /run/secrets/github_token ]; then \ - export GITHUB_TOKEN=$(cat /run/secrets/github_token) && \ - echo "Using GitHub token for private repo access" && \ - git clone https://${GITHUB_TOKEN}@github.com/Memo-2023/mana-core-nestjs-package.git /tmp/mana-core; \ - else \ - echo "No GitHub token provided, attempting public clone" && \ - git clone https://github.com/Memo-2023/mana-core-nestjs-package.git /tmp/mana-core; \ - fi && \ - cd /tmp/mana-core && \ - npm install --force && \ - npm run build && \ - npm pack && \ - mv *.tgz /app/mana-core.tgz && \ - echo "Mana-core packaged as tarball at /app/mana-core.tgz" +RUN apk add --no-cache python3 make g++ # Copy package.json COPY apps/manadeck/apps/backend/package.json ./ -# Replace GitHub URL with the tarball -RUN sed -i 's|"git+https://github.com/Memo-2023/mana-core-nestjs-package.git"|"file:mana-core.tgz"|g' package.json || \ - sed -i 's|"github:Memo-2023/mana-core-nestjs-package"|"file:mana-core.tgz"|g' package.json - -# Debug: Verify the replacement and file existence -RUN echo "=== Verifying tarball and package.json ===" && \ - ls -la mana-core.tgz && \ - echo "Tarball exists at /app/mana-core.tgz" && \ - echo "Checking package.json replacement:" && \ - grep -n "mana-core" package.json && \ - echo "=== End verification ===" - # Install dependencies -RUN npm install --legacy-peer-deps && \ - echo "Dependencies installed with mana-core from tarball" +RUN npm install --legacy-peer-deps # Copy source code COPY apps/manadeck/apps/backend/ ./