diff --git a/web/components/solution/ExecutorUIDisplay.tsx b/web/components/solution/ExecutorUIDisplay.tsx index 9256afd..81e4d89 100644 --- a/web/components/solution/ExecutorUIDisplay.tsx +++ b/web/components/solution/ExecutorUIDisplay.tsx @@ -6,7 +6,7 @@ export interface ExecutorUIDisplayProps { } const ExecutorUIDisplay = ({ jobId, onClose }: ExecutorUIDisplayProps) => { - const apiUrl = process.env.EXECUTOR_UI_URL ?? "http://localhost:3007"; + const apiUrl = process.env.NODE_ENV === "production" ? "https://executor.code-canvas.app" : "http://localhost:3007"; return ( diff --git a/web/docker-compose.yml b/web/docker-compose.yml new file mode 100644 index 0000000..31becca --- /dev/null +++ b/web/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3' + +services: + web: + image: ghcr.io/mathisburger/codecanvas-web:v0.1.0 + ports: + - "3001:3000" + environment: + - API_URL=https://api.code-canvas.app + - EXECUTOR_UI_URL=https://executor.code-canvas.app diff --git a/web/package.json b/web/package.json index 1453ef1..b1bc259 100644 --- a/web/package.json +++ b/web/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev", - "build": "next build", + "build": "NODE_ENV=production next build", "start": "next start", "lint": "next lint" }, diff --git a/web/service/ApiService.ts b/web/service/ApiService.ts index 3630fa0..f17db01 100644 --- a/web/service/ApiService.ts +++ b/web/service/ApiService.ts @@ -26,7 +26,7 @@ class ApiService { private apiUrl: string; constructor() { - this.apiUrl = process.env.API_URL ?? "http://localhost:3002"; + this.apiUrl = process.env.NODE_ENV === "production" ? "https://api.code-canvas.app" : "http://localhost:3002"; } public async self(): Promise {