EnglishPal/build.sh

22 lines
632 B
Bash
Raw Normal View History

#!/bin/sh
DEPLOYMENT_DIR=/home/lanhui/englishpal2/EnglishPal
cd $DEPLOYMENT_DIR
pwd
2023-03-21 16:07:10 +08:00
# Install dependencies
#pip3 install -r requirements.txt
2023-03-21 16:07:10 +08:00
# Stop service
sudo docker stop EnglishPal
sudo docker rm EnglishPal
# Rebuild container. Run this after modifying the source code.
sudo docker build -t englishpal .
# Run the application
2023-07-17 10:25:07 +08:00
sudo docker run --restart=always -d --name EnglishPal -p 90:80 -v ${DEPLOYMENT_DIR}/app/static/frequency:/app/static/frequency --mount type=volume,src=englishpal-db,target=/app -t englishpal # for permanently saving data
# Save space. Run it after sudo docker run
sudo docker system prune -a -f