Преглед изворни кода

Adding port to docker script

Kirk Trombley пре 5 година
родитељ
комит
7e0ccabf9f
1 измењених фајлова са 9 додато и 3 уклоњено
  1. 9 3
      run-docker.sh

+ 9 - 3
run-docker.sh

@@ -26,6 +26,12 @@ else
     CONTAINER_NAME="ggsh-instance"
 fi
 
+if [ -z "$PORT" ]
+then
+    echo "Defaulting to PORT=8080"
+    PORT=8080
+fi
+
 status_check() {
     docker inspect -f '{{.State.Running}}' $CONTAINER_NAME 2> /dev/null
 }
@@ -65,9 +71,9 @@ case $1 in
         echo "Building GeoGuessr Self Host image as ggsh:latest"
         docker build -t ggsh:latest .
         echo "Executing new container $CONTAINER_NAME using ggsh:latest"
-        docker run -p6070:80 --name $CONTAINER_NAME -d ggsh
-        echo "Geoguessr Self Host UI accessible at http://localhost:6070/"
-        echo "Geoguessr Self Host API accessible at http://localhost:6070/api/"
+        docker run -p$PORT:80 --name $CONTAINER_NAME -d ggsh
+        echo "Geoguessr Self Host UI accessible at http://localhost:$PORT/"
+        echo "Geoguessr Self Host API accessible at http://localhost:$PORT/api/"
     ;;
     "c"|"clean")
         clean_container