浏览代码

update config

guoenzhou 1 年之前
父节点
当前提交
3cdce48498
共有 3 个文件被更改,包括 23 次插入13 次删除
  1. 1 1
      docker/deploy.sh
  2. 5 2
      docker/docker-compose.yml
  3. 17 10
      docker/nginx/conf/nginx.conf

+ 1 - 1
docker/deploy.sh

@@ -31,7 +31,7 @@ base(){
 
 # 启动程序模块(必须)
 modules(){
-	docker-compose up -d ruoyi-gateway  ruoyi-system
+	docker-compose up -d ruoyi-ui ruoyi-gateway  ruoyi-system
 }
 
 # 关闭所有环境/模块

+ 5 - 2
docker/docker-compose.yml

@@ -49,14 +49,15 @@ services:
       - ./redis/conf/redis.conf:/home/ruoyi/redis/redis.conf
       - ./redis/data:/data
     command: redis-server /home/ruoyi/redis/redis.conf
-  ruoyi-nginx:
-    container_name: ruoyi-nginx
+  ruoyi-ui:
+    container_name: ruoyi-ui
     image: nginx
     build:
       context: ./nginx
     ports:
       - "80:80"
     volumes:
+      - /etc/hosts:/etc/hosts
       - ./nginx/html/dist:/home/ruoyi/projects/ruoyi-ui
       - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
       - ./nginx/logs:/var/log/nginx
@@ -73,6 +74,7 @@ services:
       - /etc/hosts:/etc/hosts
     depends_on:
       - ruoyi-redis
+      - ruoyi-nacos
     links:
       - ruoyi-redis
   ruoyi-system:
@@ -88,6 +90,7 @@ services:
     depends_on:
       - ruoyi-redis
       - ruoyi-mysql
+      - ruoyi-nacos
     links:
       - ruoyi-redis
       - ruoyi-mysql

+ 17 - 10
docker/nginx/conf/nginx.conf

@@ -14,23 +14,30 @@ http {
         listen       80;
         server_name  localhost;
 
-		location / {
+     location / {
             root   /home/ruoyi/projects/ruoyi-ui;
 			try_files $uri $uri/ /index.html;
             index  index.html index.htm;
-        }
+      }
 		
-		location /prod-api/{
-			proxy_set_header Host $http_host;
-			proxy_set_header X-Real-IP $remote_addr;
-			proxy_set_header REMOTE-HOST $remote_addr;
-			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-			proxy_pass http://localhost:8080/;
-		}
+      location /prod-api/{
+		proxy_set_header Host $http_host;
+		proxy_set_header X-Real-IP $remote_addr;
+		proxy_set_header REMOTE-HOST $remote_addr;
+		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+		proxy_pass http://usky-cloud-gateway:9150/;
+      }
+      location /dev-api/{
+		proxy_set_header Host $http_host;
+		proxy_set_header X-Real-IP $remote_addr;
+		proxy_set_header REMOTE-HOST $remote_addr;
+		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+		proxy_pass http://usky-cloud-gateway:9150/;
+      }
 
         error_page   500 502 503 504  /50x.html;
         location = /50x.html {
             root   html;
         }
     }
-}
+}