2021-07-16 19:04:43 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-11-01 21:43:01 +08:00
|
|
|
DEPLOYMENT_DIR=/home/lanhui/englishpal2/EnglishPal
|
2022-02-07 13:56:14 +08:00
|
|
|
cd $DEPLOYMENT_DIR
|
2021-07-16 19:04:43 +08:00
|
|
|
|
2023-03-21 16:07:10 +08:00
|
|
|
# Install dependencies
|
|
|
|
|
|
|
|
pip3 install -r requirements.txt
|
|
|
|
|
2021-07-16 19:04:43 +08:00
|
|
|
# Stop service
|
|
|
|
sudo docker stop EnglishPal
|
2021-07-30 13:20:01 +08:00
|
|
|
sudo docker rm EnglishPal
|
2021-07-16 19:04:43 +08:00
|
|
|
|
|
|
|
# Rebuild container. Run this after modifying the source code.
|
|
|
|
sudo docker build -t englishpal .
|
|
|
|
|
|
|
|
# Run the application
|
2022-11-01 21:43:01 +08:00
|
|
|
sudo docker run --restart=always -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
|
2021-07-16 19:04:43 +08:00
|
|
|
|
|
|
|
# Save space. Run it after sudo docker run
|
|
|
|
sudo docker system prune -a -f
|