From 3609e1f2fce545ab3db9797fa6281eab7ae3f563 Mon Sep 17 00:00:00 2001 From: Erwin Date: Fri, 27 Mar 2026 21:52:01 +0000 Subject: [PATCH] Restore docker files and gateway URL fix --- Dockerfile | 20 ++++++++++++++++++++ docker-compose.yml | 24 ++++++++++++++++++++++++ nginx.conf | 20 ++++++++++++++++++++ src/lib/openclaw-api.ts | 2 +- 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ca276c6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Build stage +FROM node:20-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +# Production stage +FROM nginx:alpine + +COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a10e5d2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +services: + mission-control-ui: + build: + context: . + dockerfile: Dockerfile + container_name: mission-control-ui + restart: unless-stopped + ports: + - "3000:80" + environment: + - VITE_OPENCLAW_GATEWAY_URL=http://10.5.0.192:18789 + - VITE_OPENCLAW_GATEWAY_TOKEN=19c9f14e73656d544d38ab32f314cea95c5991e7eee46080 + labels: + - "traefik.enable=true" + - "traefik.http.routers.mission-control-ui.rule=Host(`mission-control.danielarroyo.cl`)" + - "traefik.http.routers.mission-control-ui.entrypoints=websecure" + - "traefik.http.routers.mission-control-ui.tls.certresolver=letsencrypt" + - "traefik.http.services.mission-control-ui.loadbalancer.server.port=80" + networks: + - traefik + +networks: + traefik: + external: true diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..5ddd503 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,20 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + location = /index.html { + expires -1; + add_header Cache-Control "no-store, no-cache, must-revalidate"; + } +} diff --git a/src/lib/openclaw-api.ts b/src/lib/openclaw-api.ts index 5b353fe..b2f254e 100644 --- a/src/lib/openclaw-api.ts +++ b/src/lib/openclaw-api.ts @@ -300,7 +300,7 @@ let _client: OpenClawGatewayClient | null = null export function getOpenClawClient(gatewayUrl?: string, token?: string): OpenClawGatewayClient { if (!_client) { const url = gatewayUrl - ?? (typeof window !== 'undefined' ? window.location.origin : 'http://127.0.0.1:18789') + ?? (typeof window !== 'undefined' ? 'http://10.5.0.192:18789' : 'http://10.5.0.192:18789') const tk = token ?? '' _client = new OpenClawGatewayClient(url, tk) }