diff --git a/.env b/.env index 5f20d36..fb510ff 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -NEXT_PUBLIC_API_BASE_URL=http://localhost:8070 \ No newline at end of file +API_BASE_URL=http://localhost:8070 diff --git a/Dockerfile b/Dockerfile index 67ce45f..8bf5082 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apk update RUN apk add --no-cache libc6-compat # Setup pnpm on the alpine base -FROM alpine as base +FROM alpine AS base RUN npm install pnpm --global RUN pnpm config set store-dir ~/.pnpm-store @@ -23,7 +23,7 @@ RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm install --frozen-lockfi # Copy source code COPY . . -ENV NEXT_TELEMETRY_DISABLED 1 +ENV NEXT_TELEMETRY_DISABLED=1 RUN pnpm build # Final image diff --git a/README.md b/README.md index 9d0cc30..5c5d812 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The easiest way to use the Flowdapt dashboard is by simply running the Docker im docker run --network=host ghcr.io/emergentmethods/flowdapt-dashboard:latest ``` -It will run the dashboard on `http://localhost:3030` and it will look for a running Flowdapt server on `http://localhost:8070`. If you are running Flowdapt at a different location, you can specify that by controlling the environment variable `NEXT_PUBLIC_API_BASE_URL=http://localhost:8070`. +It will run the dashboard on `http://localhost:3030` and it will look for a running Flowdapt server on `http://localhost:8070`. If you are running Flowdapt at a different location, you can specify that by controlling the environment variable `API_BASE_URL=http://localhost:8070`. ### Project Setup Guide diff --git a/src/lib/util.ts b/src/lib/util.ts index 247f73f..573443e 100644 --- a/src/lib/util.ts +++ b/src/lib/util.ts @@ -77,8 +77,9 @@ export const getLanguage = (props: Flowdapt.IPageParams) => { * @returns The created Configuration object with the basePath set. */ export const getClient = () => { + const baseUrl = process.env.API_BASE_URL || "http://localhost:8070"; const flowdaptSDKClient = new FlowdaptSDK({ - baseUrl: process.env.NEXT_PUBLIC_API_BASE_URL, + baseUrl, }); return flowdaptSDKClient; diff --git a/types/global.d.ts b/types/global.d.ts index a23aee0..590884a 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -7,7 +7,7 @@ interface Window { declare namespace NodeJS { interface ProcessEnv { // Declare environment variables here - NEXT_PUBLIC_API_URL: string; + API_BASE_URL: string; } }