1
0
Fork 0

Try to figure out how to rebuild the image after updating the source code.

Alpha-snapshot20230621
Hui Lan 2023-08-10 10:47:57 +08:00
parent a397c756cf
commit 00ae957b27
3 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,5 @@
FROM tiangolo/uwsgi-nginx-flask:python3.8 FROM tiangolo/uwsgi-nginx-flask:python3.8-alpine
COPY requirements.txt /app COPY requirements.txt /app
RUN pip3 install -U pip
RUN pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ RUN pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
COPY ./app /app COPY ./app/ /app/

View File

@ -39,7 +39,7 @@
<input type="password" placeholder="密码" class="password" id="password"> <input type="password" placeholder="密码" class="password" id="password">
<button type="button" class="btn" onclick="login()">登录</button> <button type="button" class="btn" onclick="login()">登录</button>
<a class="signup" href="/signup">注册</a> <a class="signup" href="/signup">注册</a>
<label class="form-text">2023-08-10</label>
</div> </div>
{% endif %} {% endif %}

View File

@ -2,17 +2,17 @@
DEPLOYMENT_DIR=/home/lanhui/englishpal2/EnglishPal DEPLOYMENT_DIR=/home/lanhui/englishpal2/EnglishPal
cd $DEPLOYMENT_DIR cd $DEPLOYMENT_DIR
pwd
# Install dependencies # Install dependencies
pip3 install -r requirements.txt #pip3 install -r requirements.txt
# Stop service # Stop service
sudo docker stop EnglishPal sudo docker stop EnglishPal
sudo docker rm EnglishPal sudo docker rm EnglishPal
# Rebuild container. Run this after modifying the source code. # Rebuild container. Run this after modifying the source code.
sudo docker build -t englishpal --no-cache . sudo docker build -t englishpal .
# Run the application # Run the application
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 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