From 306f7f83913f826b8f6be65c5e8cc88a4c782dd3 Mon Sep 17 00:00:00 2001 From: "milinsoft@gmail.com" Date: Sun, 12 May 2024 15:53:44 +0200 Subject: [PATCH] docker --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64eb54c..7c64804 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,10 @@ RUN set -ex \ && apk add --update --no-cache git python3 py3-pip \ && git clone $GIT_REPO_URL $PROJECT_FOLDER -b $branch --depth=1 \ && python3 -m venv venv \ - && chmod +x ./venv/bin/activate \ - && ./venv/bin/pip install -r $PROJECT_FOLDER/requirements.txt \ - && ln -sf /venv/bin/python /usr/bin/python \ + && source venv/bin/activate \ + && pip install -r $PROJECT_FOLDER/requirements.txt \ && apk del git \ && rm -rf /var/cache/apk/* /root/.cache $PROJECT_FOLDER/.git -# FIXME: Fix command in the final version -CMD ["python", "-m", "unittest", "discover", "bank_app"] +# Activate the virtual environment and run unit tests +CMD ["sh", "-c", "source /app/venv/bin/activate && python -m unittest discover bank_app"]