Restore docker files and gateway URL fix
This commit is contained in:
20
Dockerfile
Normal file
20
Dockerfile
Normal 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
24
docker-compose.yml
Normal 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
20
nginx.conf
Normal 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";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -300,7 +300,7 @@ let _client: OpenClawGatewayClient | null = null
|
|||||||
export function getOpenClawClient(gatewayUrl?: string, token?: string): OpenClawGatewayClient {
|
export function getOpenClawClient(gatewayUrl?: string, token?: string): OpenClawGatewayClient {
|
||||||
if (!_client) {
|
if (!_client) {
|
||||||
const url = gatewayUrl
|
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 ?? ''
|
const tk = token ?? ''
|
||||||
_client = new OpenClawGatewayClient(url, tk)
|
_client = new OpenClawGatewayClient(url, tk)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user