build.sh: use a variable DEPLOYMENT_DIR to represent the code folder #24
7
build.sh
7
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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue