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"]