From 2488aad3527e4ed545a633776f9aa9a3df909ae7 Mon Sep 17 00:00:00 2001 From: Taka Date: Sun, 22 Mar 2020 17:20:35 +0000 Subject: [PATCH] Made the container port numbers configurable. --- docker-compose.yml | 4 ++-- run-containers.sh | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 168fe54..c448577 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: image: asl-articles-web:$TAG build: web ports: - - "3002:80" + - "$WEB_PORTNO:80" flask: image: asl-articles-flask:$TAG build: @@ -15,7 +15,7 @@ services: args: ENABLE_TESTS: $ENABLE_TESTS ports: - - "5002:5000" + - "$FLASK_PORTNO:5000" volumes: - $SQLITE:/data/sqlite.db - $EXTERNAL_DOCS_BASEDIR:/data/docs/ diff --git a/run-containers.sh b/run-containers.sh index 1f3127c..bfe2a36 100755 --- a/run-containers.sh +++ b/run-containers.sh @@ -28,6 +28,8 @@ cd `dirname "$0"` export TAG= export DBCONN= export SQLITE= +export WEB_PORTNO=3002 +export FLASK_PORTNO=5002 export EXTERNAL_DOCS_BASEDIR= export USER_FILES_BASEDIR= export ASLRB_BASE_URL= @@ -39,7 +41,7 @@ if [ $# -eq 0 ]; then print_help exit 0 fi -params="$(getopt -o t:d:e:u:r:a:h -l tag:,dbconn:,extdocs:,user-files:,aslrb:,author-aliases:,help --name "$0" -- "$@")" +params="$(getopt -o t:d:e:u:r:a:h -l tag:,dbconn:,web-portno:,flask-portno:,extdocs:,user-files:,aslrb:,author-aliases:,help --name "$0" -- "$@")" if [ $? -ne 0 ]; then exit 1; fi eval set -- "$params" while true; do @@ -50,6 +52,12 @@ while true; do -d | --dbconn ) DBCONN=$2 shift 2 ;; + --web-portno ) + WEB_PORTNO=$2 + shift 2 ;; + --flask-portno ) + FLASK_PORTNO=$2 + shift 2 ;; -e | --extdocs ) EXTERNAL_DOCS_BASEDIR=$2 shift 2 ;;