Restore docker files and gateway URL fix

This commit is contained in:
Erwin
2026-03-27 21:52:01 +00:00
parent 1acf1c4ff5
commit 3609e1f2fc
4 changed files with 65 additions and 1 deletions

20
Dockerfile Normal file
View File

@@ -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;"]

24
docker-compose.yml Normal file
View File

@@ -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

20
nginx.conf Normal file
View File

@@ -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";
}
}

View File

@@ -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)
}