resolve conflict
This commit is contained in:
@@ -4,10 +4,4 @@ import tailwindcss from '@tailwindcss/vite'
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tailwindcss()],
|
plugins: [react(), tailwindcss()],
|
||||||
server: {
|
|
||||||
host: true,
|
|
||||||
proxy: {
|
|
||||||
'/api': 'http://localhost:3001',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import react from '@vitejs/plugin-react'
|
||||||
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react(), tailwindcss()],
|
||||||
|
server: {
|
||||||
|
host: true,
|
||||||
|
proxy: {
|
||||||
|
'/api': 'http://localhost:3001',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
+18
-5
@@ -2,8 +2,8 @@ services:
|
|||||||
backend:
|
backend:
|
||||||
build: ./server
|
build: ./server
|
||||||
container_name: dashboard-backend
|
container_name: dashboard-backend
|
||||||
ports:
|
expose:
|
||||||
- "3001:3001"
|
- "3001" # Remove public port, keep internal only
|
||||||
environment:
|
environment:
|
||||||
# Root path on the Docker host to mount inside the container.
|
# Root path on the Docker host to mount inside the container.
|
||||||
# Linux VM: HOST_BROWSE_ROOT=/home/wnc
|
# Linux VM: HOST_BROWSE_ROOT=/home/wnc
|
||||||
@@ -23,8 +23,21 @@ services:
|
|||||||
frontend:
|
frontend:
|
||||||
build: ./dashboard
|
build: ./dashboard
|
||||||
container_name: dashboard-frontend
|
container_name: dashboard-frontend
|
||||||
ports:
|
expose:
|
||||||
- "5173:80"
|
- "5173" # Remove public port, keep internal only
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
image: nginx:alpine
|
||||||
|
container_name: dashboard-nginx
|
||||||
|
ports:
|
||||||
|
- "80:80" # Single public entry point
|
||||||
|
volumes:
|
||||||
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
- frontend
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
services:
|
||||||
|
backend:
|
||||||
|
build: ./server
|
||||||
|
container_name: dashboard-backend
|
||||||
|
ports:
|
||||||
|
- "3001:3001"
|
||||||
|
environment:
|
||||||
|
# Root path on the Docker host to mount inside the container.
|
||||||
|
# Dashboard VM: HOST_BROWSE_ROOT=/home/wnc
|
||||||
|
# Windows Docker Desktop: HOST_BROWSE_ROOT=C:/Users
|
||||||
|
# Then enter paths under /host/... in the dashboard settings.
|
||||||
|
- HOST_BROWSE_ROOT=${HOST_BROWSE_ROOT:-/home/wnc}
|
||||||
|
- HOST_MOUNT_ROOT=/host
|
||||||
|
volumes:
|
||||||
|
- type: bind
|
||||||
|
source: ./server
|
||||||
|
target: /app
|
||||||
|
- type: bind
|
||||||
|
source: ${HOST_BROWSE_ROOT:-/home/wnc}
|
||||||
|
target: /host
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
build: ./dashboard
|
||||||
|
container_name: dashboard-frontend
|
||||||
|
ports:
|
||||||
|
- "5173:80"
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
restart: unless-stopped
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
upstream backend {
|
||||||
|
server backend:3001;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream frontend {
|
||||||
|
server frontend:80;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
# Frontend (default)
|
||||||
|
location / {
|
||||||
|
proxy_pass http://frontend;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|
||||||
|
# Required for Vite HMR (hot reload) if in dev mode
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Backend API
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://backend;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user