From 204147d01a345bfda4d42c1d43817a82f240fbd6 Mon Sep 17 00:00:00 2001 From: arne Date: Fri, 3 Feb 2023 20:48:23 +0100 Subject: [PATCH] create python venv when needed --- app.py | 2 +- entrypoint.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 1d334dc..c249084 100644 --- a/app.py +++ b/app.py @@ -8,7 +8,7 @@ vars = {} logging.basicConfig( format="%(asctime)s %(message)s", - level=logging.INFO, + level=logging.INFO ) async def handshake(ws,data): diff --git a/entrypoint.sh b/entrypoint.sh index a04eb9c..2006d9f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,7 +3,11 @@ BASE=$(dirname $0) cd $BASE git pull -python3 -m venv env +if [ -d env ]; +then + python3 -m venv env +fi + source env/bin/activate pip3 install -U -r requirements.txt exec python3 app.py