From d304951767c3727029fcfbe2c02174c73214014f Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Wed, 31 Dec 2025 21:15:57 -0300 Subject: [PATCH] fix(core): update dockerfiles and add build scripts for core modules --- billing-finance-core/Dockerfile | 4 ++-- build_new_modules.sh | 30 ++++++++++++++++++++++++++++++ fix_failed_builds.sh | 27 +++++++++++++++++++++++++++ platform-projects-core/Dockerfile | 2 +- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 build_new_modules.sh create mode 100644 fix_failed_builds.sh diff --git a/billing-finance-core/Dockerfile b/billing-finance-core/Dockerfile index 6344b39..cd1a7ba 100644 --- a/billing-finance-core/Dockerfile +++ b/billing-finance-core/Dockerfile @@ -37,8 +37,8 @@ ENV NODE_ENV=production # Copy necessary files from build stages COPY --from=prod-deps /app/node_modules ./node_modules -COPY --from=builder /app/dist ./dist +COPY --from=builder /usr/src/app/dist ./dist # Copy prisma folder might be needed for migrations or schema references -COPY --from=builder /app/prisma ./prisma +COPY --from=builder /usr/src/app/prisma ./prisma CMD ["dist/main.js"] diff --git a/build_new_modules.sh b/build_new_modules.sh new file mode 100644 index 0000000..f7dd218 --- /dev/null +++ b/build_new_modules.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e +REGISTRY="rg.fr-par.scw.cloud/yumi" +MODULES=( + "billing-finance-core" + "crm-core" + "repo-integrations-core" + "observability-core" + "platform-projects-core" + "security-governance-core" + "baas-control-plane" + "automation-jobs-core" +) + +for module in "${MODULES[@]}"; do + echo "🚀 Building $module..." + + # Check if Dockerfile.api exists (for automation-jobs-core) + if [ -f "./$module/Dockerfile.api" ]; then + podman build -t "$REGISTRY/$module:latest" -f "./$module/Dockerfile.api" "./$module" + else + podman build -t "$REGISTRY/$module:latest" "./$module" + fi + + echo "🚀 Pushing $module..." + podman push "$REGISTRY/$module:latest" + echo "✅ $module done!" +done + +echo "🎉 All modules built and pushed!" diff --git a/fix_failed_builds.sh b/fix_failed_builds.sh new file mode 100644 index 0000000..0b5ee82 --- /dev/null +++ b/fix_failed_builds.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e +REGISTRY="rg.fr-par.scw.cloud/yumi" +MODULES=( + "platform-projects-core" + "security-governance-core" + "baas-control-plane" + "automation-jobs-core" +) + +for module in "${MODULES[@]}"; do + echo "🚀 Building $module..." + + if [ "$module" == "automation-jobs-core" ]; then + if [ -f "./$module/Dockerfile.api" ]; then + podman build -t "$REGISTRY/$module:latest" -f "./$module/Dockerfile.api" "./$module" + fi + else + podman build -t "$REGISTRY/$module:latest" "./$module" + fi + + echo "🚀 Pushing $module..." + podman push "$REGISTRY/$module:latest" + echo "✅ $module done!" +done + +echo "🎉 Failed modules fixed!" diff --git a/platform-projects-core/Dockerfile b/platform-projects-core/Dockerfile index a09c84f..689315a 100644 --- a/platform-projects-core/Dockerfile +++ b/platform-projects-core/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-alpine AS builder +FROM docker.io/library/golang:1.22-alpine AS builder WORKDIR /app RUN apk add --no-cache git COPY go.mod go.sum ./