diff --git a/.env.example b/.env.example index f038cd1e2..b7fb4edf7 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,7 @@ # Comment out to enable DEFAULT_HOST=ci.foo.redhat.com HOT_RELOAD='false' +# WEBPACK_BIND=192.168.0.2 # Enable/uncomment this to run chrome locally # CHROME_DIR=../insights-chrome diff --git a/config/devserver.config.js b/config/devserver.config.js index 6e54e69ee..7f33fc990 100644 --- a/config/devserver.config.js +++ b/config/devserver.config.js @@ -2,6 +2,14 @@ /* global module */ let default_host; +const bindHost = () => { + if (process.env.IN_DOCKER && typeof(process.env.WEBPACK_BIND) === 'undefined') { + return '0.0.0.0'; + } else { + return process.env.WEBPACK_BIND || 'localhost'; + } +}; + if (process.env.DEFAULT_HOST) { default_host = process.env.DEFAULT_HOST; } else { @@ -23,6 +31,7 @@ const devserverConfig = { hot: hotReload(), injectClient: hotReload(), inline: hotReload(), + host: bindHost(), allowedHosts: [ 'ci.foo.redhat.com', 'qa.foo.redhat.com', diff --git a/entrypoint.sh b/entrypoint.sh index bfa89e5af..87d65b5b0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,4 +6,6 @@ if [[ ! -d "/compliance/node_modules/@redhat-cloud-services" ]]; then cd /compliance; /usr/bin/npm install; fi +export IN_DOCKER='true'; + exec "$@"