update
This commit is contained in:
@@ -1,32 +0,0 @@
|
|||||||
services:
|
|
||||||
frontend:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: packages/frontend/Dockerfile
|
|
||||||
container_name: nexus-terminal-frontend
|
|
||||||
ports:
|
|
||||||
- "18111:80"
|
|
||||||
depends_on:
|
|
||||||
- backend
|
|
||||||
networks:
|
|
||||||
- nexus-terminal-network
|
|
||||||
|
|
||||||
backend:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: packages/backend/Dockerfile
|
|
||||||
container_name: nexus-terminal-backend
|
|
||||||
ports:
|
|
||||||
- "18112:3001"
|
|
||||||
environment:
|
|
||||||
NODE_ENV: production
|
|
||||||
PORT: 3001
|
|
||||||
volumes:
|
|
||||||
- ./data:/app/data
|
|
||||||
networks:
|
|
||||||
- nexus-terminal-network
|
|
||||||
|
|
||||||
|
|
||||||
networks:
|
|
||||||
nexus-terminal-network:
|
|
||||||
driver: bridge
|
|
||||||
+35
-4
@@ -1,28 +1,59 @@
|
|||||||
services:
|
services:
|
||||||
frontend:
|
frontend:
|
||||||
image: heavrnl/nexus-terminal-frontend
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: packages/frontend/Dockerfile
|
||||||
container_name: nexus-terminal-frontend
|
container_name: nexus-terminal-frontend
|
||||||
ports:
|
ports:
|
||||||
- "18111:80"
|
- "18111:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
|
- rdp # Added rdp dependency
|
||||||
networks:
|
networks:
|
||||||
- nexus-terminal-network
|
- nexus-terminal-network
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
image: heavrnl/nexus-terminal-backend
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: packages/backend/Dockerfile
|
||||||
container_name: nexus-terminal-backend
|
container_name: nexus-terminal-backend
|
||||||
ports:
|
ports:
|
||||||
- "18112:3001"
|
- "18112:3001"
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
PORT: 3001
|
PORT: 3001
|
||||||
|
RDP_BACKEND_API_BASE: http://rdp:9090 # Add URL for backend to reach RDP service
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
networks:
|
networks:
|
||||||
- nexus-terminal-network
|
- nexus-terminal-network
|
||||||
|
|
||||||
|
rdp:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: packages/rdp/Dockerfile
|
||||||
|
container_name: nexus-terminal-rdp
|
||||||
|
environment:
|
||||||
|
GUACD_HOST: guacd
|
||||||
|
GUACD_PORT: 4822
|
||||||
|
API_PORT: 9090 # Default API port for rdp service
|
||||||
|
GUAC_WS_PORT: 8081 # Default WebSocket port for rdp service
|
||||||
|
FRONTEND_URL: http://frontend # Allow CORS from frontend container
|
||||||
|
MAIN_BACKEND_URL: http://backend:3001 # Allow CORS from backend container
|
||||||
|
NODE_ENV: production
|
||||||
|
networks:
|
||||||
|
- nexus-terminal-network
|
||||||
|
depends_on:
|
||||||
|
- guacd
|
||||||
|
- backend
|
||||||
|
|
||||||
|
guacd:
|
||||||
|
image: guacamole/guacd:latest
|
||||||
|
container_name: nexus-terminal-guacd
|
||||||
|
networks:
|
||||||
|
- nexus-terminal-network
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
nexus-terminal-network:
|
nexus-terminal-network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
name: nexus-terminal-network
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
services:
|
||||||
|
frontend:
|
||||||
|
image: heavrnl/nexus-terminal-frontend
|
||||||
|
container_name: nexus-terminal-frontend
|
||||||
|
ports:
|
||||||
|
- "18111:80"
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
- rdp # Added rdp dependency
|
||||||
|
networks:
|
||||||
|
- nexus-terminal-network
|
||||||
|
|
||||||
|
backend:
|
||||||
|
image: heavrnl/nexus-terminal-backend
|
||||||
|
container_name: nexus-terminal-backend
|
||||||
|
ports:
|
||||||
|
- "18112:3001"
|
||||||
|
environment:
|
||||||
|
NODE_ENV: production
|
||||||
|
PORT: 3001
|
||||||
|
RDP_BACKEND_API_BASE: http://rdp:9090 # Add URL for backend to reach RDP service
|
||||||
|
volumes:
|
||||||
|
- ./data:/app/data
|
||||||
|
networks:
|
||||||
|
- nexus-terminal-network
|
||||||
|
|
||||||
|
rdp:
|
||||||
|
image: heavrnl/nexus-terminal-rdp # <-- Replace with your actual image name
|
||||||
|
container_name: nexus-terminal-rdp
|
||||||
|
environment:
|
||||||
|
GUACD_HOST: guacd
|
||||||
|
GUACD_PORT: 4822
|
||||||
|
API_PORT: 9090 # Default API port for rdp service
|
||||||
|
GUAC_WS_PORT: 8081 # Default WebSocket port for rdp service
|
||||||
|
FRONTEND_URL: http://frontend # Allow CORS from frontend container
|
||||||
|
MAIN_BACKEND_URL: http://backend:3001 # Allow CORS from backend container
|
||||||
|
NODE_ENV: production
|
||||||
|
networks:
|
||||||
|
- nexus-terminal-network
|
||||||
|
depends_on:
|
||||||
|
- guacd
|
||||||
|
- backend
|
||||||
|
|
||||||
|
guacd:
|
||||||
|
image: guacamole/guacd:latest
|
||||||
|
container_name: nexus-terminal-guacd
|
||||||
|
networks:
|
||||||
|
- nexus-terminal-network
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
networks:
|
||||||
|
nexus-terminal-network:
|
||||||
|
driver: bridge
|
||||||
|
name: nexus-terminal-network
|
||||||
@@ -31,7 +31,8 @@
|
|||||||
"sqlite3": "^5.1.7",
|
"sqlite3": "^5.1.7",
|
||||||
"ssh2": "^1.16.0",
|
"ssh2": "^1.16.0",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^11.1.0",
|
||||||
"xterm": "^5.3.0"
|
"xterm": "^5.3.0",
|
||||||
|
"ws": "^8.18.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bcrypt": "^5.0.2",
|
"@types/bcrypt": "^5.0.2",
|
||||||
|
|||||||
@@ -38,8 +38,13 @@ const desiredModalHeight = ref(858); // User sets the desired TOTAL modal height
|
|||||||
const MIN_MODAL_WIDTH = 1024;
|
const MIN_MODAL_WIDTH = 1024;
|
||||||
const MIN_MODAL_HEIGHT = 768;
|
const MIN_MODAL_HEIGHT = 768;
|
||||||
|
|
||||||
const RDP_BACKEND_API_BASE = 'http://localhost:9090';
|
const RDP_BACKEND_API_BASE = 'http://localhost:9090'; // This might need adjustment too if API is accessed directly from browser, but currently it's proxied via backend
|
||||||
const RDP_BACKEND_WEBSOCKET_URL = 'ws://localhost:8081';
|
|
||||||
|
// Dynamically construct WebSocket URL
|
||||||
|
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||||
|
const wsHost = window.location.hostname;
|
||||||
|
const wsPort = import.meta.env.VITE_RDP_WEBSOCKET_PORT || '18114'; // Read from env var or use default
|
||||||
|
const RDP_BACKEND_WEBSOCKET_URL = `${wsProtocol}//${wsHost}:${wsPort}`;
|
||||||
// Removed localStorage keys
|
// Removed localStorage keys
|
||||||
|
|
||||||
const connectRdp = async () => { // Removed useInputValues parameter
|
const connectRdp = async () => { // Removed useInputValues parameter
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Use a lightweight Node.js image
|
||||||
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
|
# Set the working directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package.json and package-lock.json
|
||||||
|
COPY packages/rdp/package.json packages/rdp/package-lock.json* ./
|
||||||
|
|
||||||
|
# Install ALL dependencies (including devDependencies like typescript)
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Copy source code and tsconfig
|
||||||
|
COPY packages/rdp/src ./src
|
||||||
|
COPY packages/rdp/tsconfig.json ./tsconfig.json
|
||||||
|
|
||||||
|
# Build the TypeScript code
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Remove development dependencies after build
|
||||||
|
RUN npm prune --production
|
||||||
|
|
||||||
|
# --- Production Stage ---
|
||||||
|
FROM node:20-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy built code and node_modules from builder stage
|
||||||
|
COPY --from=builder /app/dist ./dist
|
||||||
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
COPY packages/rdp/package.json ./package.json
|
||||||
|
|
||||||
|
# Expose the API and WebSocket ports
|
||||||
|
EXPOSE 9090
|
||||||
|
EXPOSE 8081
|
||||||
|
|
||||||
|
# Command to run the application
|
||||||
|
CMD ["node", "dist/server.js"]
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "backend",
|
"name": "@nexus-terminal/rdp",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "tsc && node dist/server.js",
|
"build": "tsc",
|
||||||
|
"start": "node dist/server.js",
|
||||||
"dev": "nodemon --exec \"ts-node --files src/server.ts\""
|
"dev": "nodemon --exec \"ts-node --files src/server.ts\""
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|||||||
Reference in New Issue
Block a user