feat: env-var-ize WS URL as CUSTOM_VITE_WS_URL, add .env.example
Docker Build (ARM64) / Build & Push (push) Successful in 50s
Docker Build (ARM64) / Build & Push (push) Successful in 50s
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user