feat: server-core → network_mode host for direct WireGuard routing
- docker-compose.yml: server-core uses host network (no bridge isolation) - docker-compose.yml: postgres/redis expose ports on 127.0.0.1 only - docker-compose.dev.yml: also uses host network - WireGuard now runs on host network stack (wg show works on host) - nftables rules apply directly to host (proper peer isolation)
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
server-core:
|
server-core:
|
||||||
build:
|
build:
|
||||||
@@ -8,5 +7,6 @@ services:
|
|||||||
command: ["sh", "-c", "go install github.com/air-verse/air@latest && air"]
|
command: ["sh", "-c", "go install github.com/air-verse/air@latest && air"]
|
||||||
volumes:
|
volumes:
|
||||||
- ./apps/server-core:/app
|
- ./apps/server-core:/app
|
||||||
|
network_mode: host
|
||||||
environment:
|
environment:
|
||||||
- GIN_MODE=debug
|
- GIN_MODE=debug
|
||||||
+7
-8
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
@@ -8,6 +7,8 @@ services:
|
|||||||
POSTGRES_DB: nexusguard
|
POSTGRES_DB: nexusguard
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:5432:5432"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U nexusguard"]
|
test: ["CMD-SHELL", "pg_isready -U nexusguard"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
@@ -21,6 +22,8 @@ services:
|
|||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
volumes:
|
volumes:
|
||||||
- redisdata:/data
|
- redisdata:/data
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:6379:6379"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "redis-cli", "ping"]
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
@@ -34,20 +37,19 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./apps/server-core
|
context: ./apps/server-core
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
network_mode: host
|
||||||
environment:
|
environment:
|
||||||
- DB_HOST=postgres
|
- DB_HOST=127.0.0.1
|
||||||
- DB_PORT=5432
|
- DB_PORT=5432
|
||||||
- DB_USER=nexusguard
|
- DB_USER=nexusguard
|
||||||
- DB_PASSWORD=${DB_PASSWORD:-nexusguard}
|
- DB_PASSWORD=${DB_PASSWORD:-nexusguard}
|
||||||
- DB_NAME=nexusguard
|
- DB_NAME=nexusguard
|
||||||
- REDIS_ADDR=redis:6379
|
- REDIS_ADDR=127.0.0.1:6379
|
||||||
- JWT_SECRET=${JWT_SECRET:-changeme}
|
- JWT_SECRET=${JWT_SECRET:-changeme}
|
||||||
- SERVER_SALT=${SERVER_SALT:-changeme}
|
- SERVER_SALT=${SERVER_SALT:-changeme}
|
||||||
- NFTABLES_TABLE=nexusguard
|
- NFTABLES_TABLE=nexusguard
|
||||||
- IPAM_POOL=10.8.0.0/16
|
- IPAM_POOL=10.8.0.0/16
|
||||||
- GIN_MODE=release
|
- GIN_MODE=release
|
||||||
ports:
|
|
||||||
- "${API_PORT:-8080}:8080"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -57,15 +59,12 @@ services:
|
|||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
- NET_RAW
|
- NET_RAW
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
|
||||||
- nexusnet
|
|
||||||
|
|
||||||
dashboard-ui:
|
dashboard-ui:
|
||||||
build:
|
build:
|
||||||
context: ./apps/dashboard-ui
|
context: ./apps/dashboard-ui
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
# Inject the root .env variable into the frontend build process
|
|
||||||
VITE_API_BASE_URL: ${VITE_API_BASE_URL}
|
VITE_API_BASE_URL: ${VITE_API_BASE_URL}
|
||||||
ports:
|
ports:
|
||||||
- "${WEB_PORT:-80}:80"
|
- "${WEB_PORT:-80}:80"
|
||||||
|
|||||||
Reference in New Issue
Block a user