From 355e524348df7e2ba5923d3328e2c43bb3af8a7c Mon Sep 17 00:00:00 2001 From: Markus Grigull Date: Fri, 21 Jul 2017 14:15:09 +0200 Subject: [PATCH] Fix docker deployment --- docker-compose.yml | 8 ++------ etc/nginx/villas.conf | 8 ++++++-- src/data-managers/rest-data-manager.js | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 58f4b4e..ff25a1a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,10 +10,8 @@ networks: services: # The VILLASweb frontend frontend: - build: + build: context: . - environment: - - REACT_APP_HTTP_PROXY ports: - "80:80" - "443:443" @@ -26,8 +24,6 @@ services: build: backend environment: - NODE_ENV=production - ports: - - "4000:4000" restart: always networks: villas: @@ -65,4 +61,4 @@ services: volumes: - "./etc/node/:/etc/villas/node/" networks: - villas: \ No newline at end of file + villas: diff --git a/etc/nginx/villas.conf b/etc/nginx/villas.conf index 58872f4..4dabe64 100644 --- a/etc/nginx/villas.conf +++ b/etc/nginx/villas.conf @@ -13,8 +13,12 @@ server { proxy_pass http://backend:4000/; } - - location /ws/ { + + location /ws/api/ { + proxy_pass http://node/api/; + } + + location /ws { proxy_pass http://node/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/src/data-managers/rest-data-manager.js b/src/data-managers/rest-data-manager.js index 749cdcd..2ae0a46 100644 --- a/src/data-managers/rest-data-manager.js +++ b/src/data-managers/rest-data-manager.js @@ -22,8 +22,7 @@ import RestAPI from '../api/rest-api'; import AppDispatcher from '../app-dispatcher'; -const HOST = process.env.REACT_APP_HTTP_PROXY || "http://localhost:4000"; -const API_URL = HOST + '/api/v1'; +const API_URL = '/api/v1'; class RestDataManager { constructor(type, url, keyFilter) {