Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Proxy can be used in front of any service

Christian Bauera2147f3a538d
diff --git a/profile/deploy.yml b/profile/deploy.yml
index 1d6803377..a17e31b56 100644
--- a/profile/deploy.yml
+++ b/profile/deploy.yml
@@ -35,11 +35,15 @@ services:
#DOMAINNAME: localhost
# Provide your own email address for your SSL certificates!
- LE_EMAIL: '[email protected]'
+ LE_EMAIL: '[email protected]'
# --staging requests fake certificates to avoid hitting limits during testing
#LE_EXTRA_ARGS: '--staging --logs-dir=/etc/letsencrypt'
+ # Traffic should be forwarded to this service
+ PROXY_BACKEND_HOST: manager
+ PROXY_BACKEND_PORT: 8080
+
# Customize log output
PROXY_LOGLEVEL: 'notice'
@@ -56,9 +60,6 @@ services:
options:
max-size: 10m
- # Always restart the service
- restart: on-failure
-
# The API gateway and Manager web application.
manager:
@@ -191,9 +192,6 @@ services:
options:
max-size: 10m
- # Always restart the service
- restart: always
-
# Keycloak identity provider
keycloak:
@@ -227,9 +225,6 @@ services:
options:
max-size: 10m
- # Always restart the service
- restart: always
-
# PostgreSQL DBMS
postgresql:
@@ -257,6 +252,3 @@ services:
logging:
options:
max-size: 10m
-
- # Always restart the service
- restart: always
diff --git a/proxy/Dockerfile b/proxy/Dockerfile
index 5f2e97e70..0342ab7ca 100644
--- a/proxy/Dockerfile
+++ b/proxy/Dockerfile
@@ -12,6 +12,8 @@ ARG DOMAINNAME
ENV DOMAINNAME=${DOMAINNAME:-localhost}
ENV TERM xterm
ENV PROXY_LOGLEVEL notice
+ENV PROXY_BACKEND_HOST manager
+ENV PROXY_BACKEND_PORT 8080
RUN mkdir /tmp/lua && cd /tmp/lua \
&& curl -sSL https://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gz -o lua.tar.gz \
diff --git a/proxy/haproxy.cfg b/proxy/haproxy.cfg
index d9294ea7b..bdb3bbf05 100644
--- a/proxy/haproxy.cfg
+++ b/proxy/haproxy.cfg
@@ -43,7 +43,7 @@ frontend https
reqadd X-Forwarded-Proto:\ https
rspadd Strict-Transport-Security:\ max-age=15768000
- use_backend manager_server
+ use_backend custom_backend
-backend manager_server
- server node1 manager:8080
+backend custom_backend
+ server node1 "${PROXY_BACKEND_HOST}":"${PROXY_BACKEND_PORT}"