diff --git a/docker/Dockerfile b/docker/Dockerfile index 7ffd24d1..65e5d2c9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,4 @@ -FROM ubuntu - -RUN apt-get update && apt-get install -y software-properties-common -RUN add-apt-repository -y ppa:nginx/stable -RUN apt-get update -RUN apt-get install -y nginx +FROM nginx:1.12-alpine ADD hydro-serving-ui/ /var/www/html/ ADD nginx/bin/ /usr/sbin/ diff --git a/docker/nginx/bin/configure-nginx.sh b/docker/nginx/bin/configure-nginx.sh index abf1bb10..071e0671 100755 --- a/docker/nginx/bin/configure-nginx.sh +++ b/docker/nginx/bin/configure-nginx.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -eu diff --git a/docker/nginx/bin/entrypoint.sh b/docker/nginx/bin/entrypoint.sh index 8a46d4fb..2e301fcf 100755 --- a/docker/nginx/bin/entrypoint.sh +++ b/docker/nginx/bin/entrypoint.sh @@ -1,6 +1,8 @@ -#!/bin/bash +#!/bin/sh set -eu -render-templates.sh /etc/nginx/sites-templates /etc/nginx/sites-enabled +sed -i "s/MANAGER_HOST/${MANAGER_HOST}/g" /etc/nginx/sites-templates/manager.conf.tmpl +rm /etc/nginx/conf.d/default.conf +cp /etc/nginx/sites-templates/manager.conf.tmpl /etc/nginx/conf.d/manager.conf exec $@ diff --git a/docker/nginx/bin/render-templates.sh b/docker/nginx/bin/render-templates.sh deleted file mode 100755 index f41f96c5..00000000 --- a/docker/nginx/bin/render-templates.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -eu - -indir="${1}" -outdir="${2}" - -function template_files() { - find "${indir}" \ - -mindepth 1 \ - -maxdepth 1 \ - -name '*.tmpl' \ - -print0 -} - -function non_template_files() { - find "${indir}" \ - -mindepth 1 \ - -maxdepth 1 \ - -not \ - -name '*.tmpl' \ - -print0 -} - -rm -rf "${outdir}" -mkdir -p "${outdir}" -template_files | xargs -0 substitute-env-vars.sh "${outdir}" -non_template_files | xargs -0 -I{} ln -s {} "${outdir}" diff --git a/docker/nginx/bin/substitute-env-vars.sh b/docker/nginx/bin/substitute-env-vars.sh deleted file mode 100755 index 48fd0ef0..00000000 --- a/docker/nginx/bin/substitute-env-vars.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -eu - -output_dir=$1 -shift -files=$@ - -function fill_in() { - perl -p -e 's/\$\{([^}]+)\}/defined $ENV{$1} ? $ENV{$1} : "\${$1}"/eg' "${1}" -} - -function output_filename { - local destname=$(basename "${1}" '.tmpl') - echo "${output_dir}/${destname}" -} - -for file in $files; do - fill_in "${file}" > $(output_filename "${file}") -done diff --git a/src/modules/models/model-details/model-details.component.html b/src/modules/models/model-details/model-details.component.html index ad5ccdb7..c7ad8af0 100644 --- a/src/modules/models/model-details/model-details.component.html +++ b/src/modules/models/model-details/model-details.component.html @@ -5,7 +5,7 @@