实现 nacos + traefik,改了很多东西!!!

This commit is contained in:
编码猿
2025-09-22 02:27:53 +08:00
parent e038fdb965
commit dabb91ef1e
71 changed files with 27668 additions and 189 deletions

View File

@@ -0,0 +1,24 @@
version: '3.8'
services:
traefik:
image: traefik:v3.0
container_name: traefik
network_mode: "host" # 主机网络模式
volumes:
- ./traefik.yml:/etc/traefik/traefik.yml
- ./dynamic.yml:/etc/traefik/dynamic.yml # 动态配置文件
restart: always
# 2. Nacos 服务监听脚本
nacos-watcher:
user: "root"
privileged: true
image: node:24.8.0-alpine3.21
container_name: nacos-watcher
network_mode: "host"
working_dir: /app
volumes:
- ./:/app # 挂载当前目录到容器
command: sh -c "npm install && node nacos-watcher.js"
restart: always