From 1f208f5f5b840a613b11ad629bafb9bac315ce06 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Fri, 25 Oct 2024 22:53:58 -0600 Subject: [PATCH] refactor(dokploy): add next public shareable key --- .github/workflows/deploy.yml | 2 ++ Dockerfile.cloud | 4 +++- .../components/dashboard/settings/billing/show-billing.tsx | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e50c72078..987800f9e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -72,6 +72,8 @@ jobs: tags: | siumauricio/cloud:${{ github.ref_name == 'main' && 'main' || 'canary' }} platforms: linux/amd64 + build-args: | + NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=${{ github.ref_name == 'main' && 'pk_live_51QAm7bF3cxQuHeOzMpfNfJIch6oLif8rS32pRE392CdTbBf0MYBdbapAxarQGspqJBWT2nVOxu8e6ZHrHB4NhVHG008DE2A90d' || 'pk_test_51QAm7bF3cxQuHeOz0xg04o9teeyTbbNHQPJ5Tr98MlTEan9MzewT3gwh0jSWBNvrRWZ5vASoBgxUSF4gPWsJwATk00Ir2JZ0S1' }} build-and-push-schedule-image: runs-on: ubuntu-latest diff --git a/Dockerfile.cloud b/Dockerfile.cloud index 255ac3ad7..664180f7f 100644 --- a/Dockerfile.cloud +++ b/Dockerfile.cloud @@ -12,8 +12,10 @@ RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib # Install dependencies RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter=@dokploy/server --filter=./apps/dokploy install --frozen-lockfile -# Deploy only the dokploy app +# Deploy only the dokploy app +ARG NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY +ENV NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=$NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY ENV NODE_ENV=production RUN pnpm --filter=@dokploy/server switch:prod RUN pnpm --filter=@dokploy/server build diff --git a/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx b/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx index 8156f7d8e..a022d87c6 100644 --- a/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx +++ b/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx @@ -10,7 +10,7 @@ import { AlertTriangle, CheckIcon, MinusIcon, PlusIcon } from "lucide-react"; import React, { useState } from "react"; const stripePromise = loadStripe( - "pk_test_51QAm7bF3cxQuHeOz0xg04o9teeyTbbNHQPJ5Tr98MlTEan9MzewT3gwh0jSWBNvrRWZ5vASoBgxUSF4gPWsJwATk00Ir2JZ0S1", + process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY || "", ); export const calculatePrice = (count: number, isAnnual = false) => { @@ -21,7 +21,6 @@ export const calculatePrice = (count: number, isAnnual = false) => { if (count <= 1) return 4.5; return count * 3.5; }; -// 178.156.147.118 export const ShowBilling = () => { const { data: servers } = api.server.all.useQuery(undefined); const { data: admin } = api.admin.one.useQuery();