From d71c99ab5d52004a358d05b3b6a04f3a90fbbaa3 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Fri, 14 Nov 2025 08:49:37 +0100 Subject: [PATCH] Bring env variables from gcloud directly --- apps/api/Dockerfile | 8 -------- apps/api/cloudbuild.yaml | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile index 9625577..734008d 100644 --- a/apps/api/Dockerfile +++ b/apps/api/Dockerfile @@ -75,10 +75,6 @@ RUN pnpm install --frozen-lockfile --prod --filter @xtablo/api... # Set working directory to api app WORKDIR /app/apps/api -# Copy .env files from build stage if they exist -RUN --mount=type=bind,from=build,source=/app/apps/api,target=/mnt/api \ - cp /mnt/api/.env* . 2>/dev/null || true - # Change ownership to nodejs user RUN chown -R nodejs:nodejs /app @@ -113,10 +109,6 @@ RUN pnpm install --frozen-lockfile --prod --filter @xtablo/api... # Set working directory to api app WORKDIR /app/apps/api -# Copy .env files from build stage if they exist -RUN --mount=type=bind,from=build,source=/app/apps/api,target=/mnt/api \ - cp /mnt/api/.env* . 2>/dev/null || true - # Change ownership to nodejs user RUN chown -R nodejs:nodejs /app diff --git a/apps/api/cloudbuild.yaml b/apps/api/cloudbuild.yaml index a78951e..dcf1094 100644 --- a/apps/api/cloudbuild.yaml +++ b/apps/api/cloudbuild.yaml @@ -13,6 +13,8 @@ steps: - 'europe-west1-docker.pkg.dev/$_AR_PROJECT_ID/$_AR_REPOSITORY/xtablo-source/$_SERVICE_NAME:$COMMIT_SHA' - '--region' - 'europe-west1' + - '--set-env-vars' + - 'NODE_ENV=$_NODE_ENV,PORT=8080,SUPABASE_URL=$_SUPABASE_URL,STREAM_CHAT_API_KEY=$_STREAM_CHAT_API_KEY,EMAIL_USER=$_EMAIL_USER,EMAIL_CLIENT_ID=$_EMAIL_CLIENT_ID,R2_ACCOUNT_ID=$_R2_ACCOUNT_ID,CORS_ORIGIN=$_CORS_ORIGIN,XTABLO_URL=$_XTABLO_URL,LOG_LEVEL=$_LOG_LEVEL' images: - 'europe-west1-docker.pkg.dev/$_AR_PROJECT_ID/$_AR_REPOSITORY/xtablo-source/$_SERVICE_NAME:$COMMIT_SHA'