From 8647af3158c1fa3423675fa03c00ea5d2ab1d607 Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Mon, 7 Feb 2022 13:56:14 +0800 Subject: [PATCH] build.sh: use a variable DEPLOYMENT_DIR to represent the code folder --- build.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 3633442..7abbbf0 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,7 @@ #!/bin/sh -cd /home/lanhui/englishpal2/EnglishPal +DEPLOYMENT_DIR=/home/lanhui/EnglishPal +cd $DEPLOYMENT_DIR # Stop service sudo docker stop EnglishPal @@ -10,9 +11,7 @@ sudo docker rm EnglishPal sudo docker build -t englishpal . # Run the application -sudo docker run -d --name EnglishPal -p 90:80 -v /home/lanhui/englishpal2/EnglishPal/app/static/frequency:/app/static/frequency -v /home/lanhui/englishpal2/EnglishPal/app/static/:/app/static/ -t englishpal # for permanently saving data +sudo docker run -d --name EnglishPal -p 90:80 -v ${DEPLOYMENT_DIR}/app/static/frequency:/app/static/frequency -v ${DEPLOYMENT_DIR}/app/static/:/app/static/ -t englishpal # for permanently saving data # Save space. Run it after sudo docker run sudo docker system prune -a -f - -