Skip to content

Commit

Permalink
allow skipping nginx build (e.g., if working offiline)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpkroth committed Jan 21, 2025
1 parent 5b7966a commit 5d4682e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions doc/nginx-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ scriptpath=$(readlink -f "$0")
scriptdir=$(dirname "$scriptpath")
cd "$scriptdir"

SKIP_NGINX_BUILD=${SKIP_NGINX_BUILD:-false}

if [ -f ../.devcontainer/.env ]; then
source ../.devcontainer/.env
fi
Expand All @@ -28,13 +30,15 @@ cmd="${1:-}"
if [ "$cmd" == 'start' ]; then
set -x
tmpdir=$(mktemp -d)
docker build --progress=plain -t mlos-doc-nginx \
--build-arg http_proxy=${http_proxy:-} \
--build-arg https_proxy=${https_proxy:-} \
--build-arg no_proxy=${no_proxy:-} \
--build-arg NGINX_PORT=$NGINX_PORT \
-f Dockerfile "$tmpdir"
rmdir "$tmpdir"
if ! $SKIP_NGINX_BUILD; then
docker build --progress=plain -t mlos-doc-nginx \
--build-arg http_proxy=${http_proxy:-} \
--build-arg https_proxy=${https_proxy:-} \
--build-arg no_proxy=${no_proxy:-} \
--build-arg NGINX_PORT=$NGINX_PORT \
-f Dockerfile "$tmpdir"
rmdir "$tmpdir"
fi
docker run -d --name mlos-doc-nginx \
-v "$repo_root/doc/nginx-default.conf":/etc/nginx/templates/default.conf.template \
-v "$repo_root/doc":/doc \
Expand Down

0 comments on commit 5d4682e

Please sign in to comment.