heavyrain 1 week ago
parent
commit
84b9c52ba7
2 changed files with 45 additions and 1 deletions
  1. 44 0
      docker-compose.debug.yml
  2. 1 1
      nginx/nginx.conf

+ 44 - 0
docker-compose.debug.yml

@@ -0,0 +1,44 @@
+services:
+  
+  frontend:
+    container_name: frontend
+    # image: trane-tech-energy-strategy-optimization-platform-frontend:v1.0
+    image: node:16-alpine
+    volumes:
+      - ../trane-tech-energy-strategy-optimization-platform-front-end:/app
+    working_dir: /app
+    command: ["sh", "-c", "npm install && npm run serve"]
+    ports:
+      - 8091:8080
+    restart: unless-stopped
+
+  backend:
+    container_name: backend
+    # image: trane-tech-energy-strategy-optimization-platform-backend:v1.0
+    image: maven:3.8.6-openjdk-8 
+    volumes:
+      - ../trane-tech-energy-strategy-optimization-platform-backend:/app
+    working_dir: /app
+    command: ["mvn", "spring-boot:run"]
+    ports:
+      - 8092:8082
+    restart: unless-stopped
+
+  nginx:
+    container_name: nginx
+    image: nginx:latest
+    volumes:
+      - ../nginx/nginx.conf:/etc/nginx/conf.d/default.conf
+    ports:
+      - 80:80
+      - 443:443
+    depends_on:
+      - frontend
+      - backend
+
+networks:
+  default:
+    driver: bridge
+
+volumes:
+  trane_data:

+ 1 - 1
nginx/nginx.conf

@@ -2,7 +2,7 @@ server {
     listen 80;
     
     location / {
-        proxy_pass http://frontend:80;  
+        proxy_pass http://frontend:8080;  
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;