feat: env-var-ize WS URL as CUSTOM_VITE_WS_URL, add .env.example
Docker Build (ARM64) / Build & Push (push) Successful in 50s

This commit is contained in:
2026-06-24 20:55:02 +02:00
parent a06c3d2e36
commit a8ee1c229e
4 changed files with 11 additions and 1 deletions
+3
View File
@@ -6,6 +6,9 @@ FROM node:20-alpine AS frontend-builder
WORKDIR /app WORKDIR /app
ARG CUSTOM_VITE_WS_URL
ENV CUSTOM_VITE_WS_URL=$CUSTOM_VITE_WS_URL
COPY package*.json ./ COPY package*.json ./
RUN --mount=type=cache,target=/root/.npm npm ci --ignore-scripts RUN --mount=type=cache,target=/root/.npm npm ci --ignore-scripts
+2
View File
@@ -15,6 +15,8 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile.canvas dockerfile: Dockerfile.canvas
args:
- CUSTOM_VITE_WS_URL=${CUSTOM_VITE_WS_URL:-wss://excalidraw.forkless.com}
image: celstnblacc/excalidraw-mcp-sentinel-canvas:latest image: celstnblacc/excalidraw-mcp-sentinel-canvas:latest
container_name: mcp-excalidraw-canvas container_name: mcp-excalidraw-canvas
ports: ports:
+1 -1
View File
@@ -435,7 +435,7 @@ function App(): JSX.Element {
return return
} }
const wsUrl = 'wss://excalidraw.forkless.com' const wsUrl = import.meta.env.CUSTOM_VITE_WS_URL || 'wss://excalidraw.forkless.com'
websocketRef.current = new WebSocket(wsUrl) websocketRef.current = new WebSocket(wsUrl)
+5
View File
@@ -1,9 +1,14 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
const wsUrl = process.env.CUSTOM_VITE_WS_URL || 'wss://excalidraw.forkless.com';
export default defineConfig({ export default defineConfig({
root: 'frontend', root: 'frontend',
plugins: [react()], plugins: [react()],
define: {
'import.meta.env.CUSTOM_VITE_WS_URL': JSON.stringify(wsUrl),
},
build: { build: {
outDir: '../dist/frontend', outDir: '../dist/frontend',
emptyOutDir: true, emptyOutDir: true,