Kaynağa Gözat

配置文件提交

lingmin_package@163.com 1 ay önce
ebeveyn
işleme
1a9bd3e4e6

+ 2 - 2
docker/docker-compose.yml

@@ -6,7 +6,7 @@ services:
     restart: always
     
     volumes:
-      - /home/lq/lq_workspace/LQAdminServer/app/config:/app/config/:rw
+      - /home/lq/lq_workspace/LQAdminServer/app/config:/app/src/app/config/:rw
       - /home/lq/lq_workspace/LQAdminServer/app/logs:/app/logs
     environment:
       - TZ=Asia/Shanghai  # 设置时区为上海(北京时间)
@@ -19,4 +19,4 @@ services:
 
 networks:
   lq_network:
-    driver: bridge
+    external: true     

+ 76 - 0
docker/milvus/docker-compose.yml

@@ -0,0 +1,76 @@
+version: '3.5'
+
+services:
+  etcd:
+    container_name: milvus-etcd
+    image: quay.io/coreos/etcd:v3.5.5
+    environment:
+      - ETCD_AUTO_COMPACTION_MODE=revision
+      - ETCD_AUTO_COMPACTION_RETENTION=1000
+      - ETCD_QUOTA_BACKEND_BYTES=4294967296
+      - ETCD_SNAPSHOT_COUNT=50000
+    volumes:
+      - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd
+    command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
+    healthcheck:
+      test: ["CMD", "etcdctl", "endpoint", "health"]
+      interval: 30s
+      timeout: 20s
+      retries: 3
+
+  minio:
+    container_name: milvus-minio
+    image: minio/minio:RELEASE.2023-03-20T20-16-18Z
+    environment:
+      MINIO_ACCESS_KEY: minioadmin
+      MINIO_SECRET_KEY: minioadmin
+    ports:
+      - "9001:9001"
+      - "9000:9000"
+    volumes:
+      - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/minio_data
+    command: minio server /minio_data --console-address ":9001"
+    healthcheck:
+      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
+      interval: 30s
+      timeout: 20s
+      retries: 3
+
+  standalone:
+    container_name: milvus-standalone
+    #image: milvusdb/milvus:v2.6.0
+    image: milvusdb/milvus:v2.6.8
+    command: ["milvus", "run", "standalone"]
+    security_opt:
+    - seccomp:unconfined
+    environment:
+      ETCD_ENDPOINTS: etcd:2379
+      MINIO_ADDRESS: minio:9000
+    volumes:
+      - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
+    healthcheck:
+      test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
+      interval: 30s
+      start_period: 90s
+      timeout: 20s
+      retries: 3
+    ports:
+      - "19530:19530"
+      - "9091:9091"
+    depends_on:
+      - "etcd"
+      - "minio"
+
+  attu:
+    container_name: milvus-attu
+    image: zilliz/attu:latest
+    environment:
+      - MILVUS_URL=standalone:19530  # 关键:使用服务名和端口
+    ports:
+      - "13000:3000"
+    depends_on:
+      - "standalone"  # 确保在 standalone 启动后启动
+
+networks:
+  default:
+    name: milvus

+ 24 - 0
docker/mysql/docker-compose.yaml

@@ -0,0 +1,24 @@
+services:
+
+  lq_mysql:
+    image: mysql:8.0.35
+    container_name: lq_mysql
+    restart: always
+
+    volumes:
+      - /home/lq/mysql/data/:/var/lib/mysql
+      - /home/lq/mysql/etc/:/etc/mysql/conf.d
+    environment:
+      TZ: Asia/Shanghai  # 设置时区为上海(北京时间)
+      MYSQL_ROOT_PASSWORD: lq123
+    ports:
+      - "13306:3306"
+    networks:
+      - lq_network
+
+
+
+networks:
+  lq_network:
+    external: true
+~                     

+ 31 - 0
docker/nginx/docker-compose.yml

@@ -0,0 +1,31 @@
+version: '3.8'
+
+services:
+  nginx:
+    image: nginx:alpine  # 使用轻量级 alpine 版本
+    container_name: nginx-web
+    restart: always
+    ports:
+      - "80:80"
+      - "443:443"
+      - "9100:9100"
+    volumes:
+      # 挂载配置文件
+      - /home/lq/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro
+      - /home/lq/nginx/conf.d:/etc/nginx/conf.d:ro
+      - /home/lq/nginx/conf/app_conf/:/etc/nginx/app_conf:ro
+      # 挂载网站文件
+      - /home/lq/nginx/html:/usr/share/nginx/html:ro
+      - /home/lq/nginx/html_app:/usr/share/nginx/html_app:ro
+      # 挂载 SSL 证书
+      - /home/lq/nginx/ssl:/etc/nginx/ssl:ro
+      # 挂载日志
+      - /home/lq/nginx/logs:/var/log/nginx
+    environment:
+      - TZ=Asia/Shanghai
+    networks:
+      - lq_network
+
+networks:
+  lq_network:
+    external: true

+ 70 - 0
docker/nginx/lq_admin_server.conf

@@ -0,0 +1,70 @@
+
+server{
+
+        listen 80;
+        server_name _;
+        root /usr/share/nginx/html;
+        index index.html index.htm;
+
+       # 如果请求根目录,重定向到 index.html
+       location = / {
+          try_files $uri $uri/ /index.html;
+       }
+
+
+        # 静态资源缓存
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
+            expires 1y;
+            add_header Cache-Control "public, immutable";
+            access_log off;
+        }
+
+        # HTML 文件不缓存
+        location ~* \.html$ {
+            expires -1;
+            add_header Cache-Control "no-cache, no-store, must-revalidate";
+            add_header Pragma "no-cache";
+        }
+
+        # API 代理(可选,如果需要代理到后端)
+        location /api/ {
+            proxy_pass http://LQAdminServer:8000/api/;
+            proxy_set_header Host $host;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_connect_timeout 30s;
+            proxy_send_timeout 30s;
+            proxy_read_timeout 30s;
+        }
+
+        # OAuth 代理
+        location /oauth/ {
+            proxy_pass http://LQAdminServer:8000/oauth/;
+            proxy_set_header Host $host;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+        }
+
+        # SPA 路由支持
+        location / {
+            try_files $uri $uri/ /index.html;
+        }
+
+        # 健康检查
+        location /health {
+            access_log off;
+            return 200 "healthy\n";
+            add_header Content-Type text/plain;
+        }
+
+        # 安全配置
+        location ~ /\. {
+            deny all;
+            access_log off;
+            log_not_found off;
+        }
+}
+~                                                                                                                                                                                                                                                                                                                            
+~          

+ 59 - 0
docker/nginx/nginx.conf

@@ -0,0 +1,59 @@
+user nginx;
+worker_processes auto;
+error_log /var/log/nginx/error.log notice;
+pid /var/run/nginx.pid;
+
+events {
+    worker_connections 1024;
+    use epoll;
+    multi_accept on;
+}
+
+http {
+    include /etc/nginx/mime.types;
+
+    # 加载外部配置
+    include /etc/nginx/app_conf/lq_admin_server.conf;
+    include /etc/nginx/app_conf/sub_system_server.conf;
+
+    default_type application/octet-stream;
+
+    # 日志格式
+    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+                    '$status $body_bytes_sent "$http_referer" '
+                    '"$http_user_agent" "$http_x_forwarded_for"';
+
+    access_log /var/log/nginx/access.log main;
+
+    # 基本配置
+    sendfile on;
+    tcp_nopush on;
+    tcp_nodelay on;
+    keepalive_timeout 65;
+    types_hash_max_size 2048;
+    client_max_body_size 10M;
+
+    # Gzip 压缩
+    gzip on;
+    gzip_vary on;
+    gzip_min_length 1024;
+    gzip_proxied any;
+    gzip_comp_level 6;
+    gzip_types
+        text/plain
+        text/css
+        text/xml
+        text/javascript
+        application/json
+        application/javascript
+        application/xml+rss
+        application/atom+xml
+        image/svg+xml;
+
+    # 安全头
+    add_header X-Frame-Options "SAMEORIGIN" always;
+    add_header X-Content-Type-Options "nosniff" always;
+    add_header X-XSS-Protection "1; mode=block" always;
+    add_header Referrer-Policy "no-referrer-when-downgrade" always;
+
+}

+ 118 - 0
docker/nginx/nginx.conf.bak

@@ -0,0 +1,118 @@
+user nginx;
+worker_processes auto;
+error_log /var/log/nginx/error.log notice;
+pid /var/run/nginx.pid;
+
+events {
+    worker_connections 1024;
+    use epoll;
+    multi_accept on;
+}
+
+http {
+    include /etc/nginx/mime.types;
+    default_type application/octet-stream;
+
+    # 日志格式
+    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+                    '$status $body_bytes_sent "$http_referer" '
+                    '"$http_user_agent" "$http_x_forwarded_for"';
+
+    access_log /var/log/nginx/access.log main;
+
+    # 基本配置
+    sendfile on;
+    tcp_nopush on;
+    tcp_nodelay on;
+    keepalive_timeout 65;
+    types_hash_max_size 2048;
+    client_max_body_size 10M;
+
+    # Gzip 压缩
+    gzip on;
+    gzip_vary on;
+    gzip_min_length 1024;
+    gzip_proxied any;
+    gzip_comp_level 6;
+    gzip_types
+        text/plain
+        text/css
+        text/xml
+        text/javascript
+        application/json
+        application/javascript
+        application/xml+rss
+        application/atom+xml
+        image/svg+xml;
+
+    # 安全头
+    add_header X-Frame-Options "SAMEORIGIN" always;
+    add_header X-Content-Type-Options "nosniff" always;
+    add_header X-XSS-Protection "1; mode=block" always;
+    add_header Referrer-Policy "no-referrer-when-downgrade" always;
+
+    server {
+        listen 80;
+        server_name _;
+        root /usr/share/nginx/html;
+        index index.html index.htm;
+
+       # 如果请求根目录,重定向到 index.html
+       location = / {
+          try_files $uri $uri/ /index.html;
+       }
+              # 静态资源缓存
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
+            expires 1y;
+            add_header Cache-Control "public, immutable";
+            access_log off;
+        }
+
+        # HTML 文件不缓存
+        location ~* \.html$ {
+            expires -1;
+            add_header Cache-Control "no-cache, no-store, must-revalidate";
+            add_header Pragma "no-cache";
+        }
+
+        # API 代理(可选,如果需要代理到后端)
+        location /api/ {
+            proxy_pass http://LQAdminServer:8000/api/;
+            proxy_set_header Host $host;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_connect_timeout 30s;
+            proxy_send_timeout 30s;
+            proxy_read_timeout 30s;
+        }
+
+        # OAuth 代理
+        location /oauth/ {
+            proxy_pass http://LQAdminServer:8000/oauth/;
+            proxy_set_header Host $host;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+                    }
+
+        # SPA 路由支持
+        location / {
+            try_files $uri $uri/ /index.html;
+        }
+
+        # 健康检查
+        location /health {
+            access_log off;
+            return 200 "healthy\n";
+            add_header Content-Type text/plain;
+        }
+
+        # 安全配置
+        location ~ /\. {
+            deny all;
+            access_log off;
+            log_not_found off;
+        }
+    }
+}

+ 68 - 0
docker/nginx/sub_system_server.conf

@@ -0,0 +1,68 @@
+
+    server {
+        listen 9100;
+        server_name _;
+        root /usr/share/nginx/html_app/sub_system;
+        index index.html index.htm;
+
+       # 如果请求根目录,重定向到 index.html
+       location = / {
+          try_files $uri $uri/ /index.html;
+       }
+
+
+        # 静态资源缓存
+        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
+            expires 1y;
+            add_header Cache-Control "public, immutable";
+            access_log off;
+        }
+
+        # HTML 文件不缓存
+        location ~* \.html$ {
+            expires -1;
+            add_header Cache-Control "no-cache, no-store, must-revalidate";
+            add_header Pragma "no-cache";
+        }
+
+        # API 代理(可选,如果需要代理到后端)
+        location /api/ {
+            proxy_pass http://SubSystemServer:8100/api/;
+            proxy_set_header Host $host;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_connect_timeout 30s;
+            proxy_send_timeout 30s;
+            proxy_read_timeout 30s;
+        }
+
+        # OAuth 代理
+        location /auth/ {
+            proxy_pass http://SubSystemServer:8100/auth/;
+            proxy_set_header Host $host;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+        }
+
+        # SPA 路由支持
+        location / {
+            try_files $uri $uri/ /index.html;
+        }
+
+        # 健康检查
+        location /health {
+            access_log off;
+            return 200 "healthy\n";
+            add_header Content-Type text/plain;
+        }
+
+        # 安全配置
+        location ~ /\. {
+            deny all;
+            access_log off;
+            log_not_found off;
+        }
+    }
+~