diff --git a/Dockerfile b/Dockerfile index a39850725..c5856bcfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,23 +25,24 @@ RUN \ RUN sed -i '/# Development/,$d' requirements.txt RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev libwebp-dev openssl-dev libffi-dev cargo openldap-dev python3-dev && \ echo -n "INPUT ( libldap.so )" > /usr/lib/libldap_r.so && \ - python -m pip install --upgrade pip && \ - pip install wheel==0.42.0 && \ - pip install setuptools_rust==1.9.0 && \ - pip install -r requirements.txt --no-cache-dir &&\ + python -m venv venv && \ + /opt/recipes/venv/bin/python -m pip install --upgrade pip && \ + venv/bin/pip install wheel==0.42.0 && \ + venv/bin/pip install setuptools_rust==1.9.0 && \ + venv/bin/pip install -r requirements.txt --no-cache-dir &&\ apk --purge del .build-deps #Copy project and execute it. COPY . ./ # collect the static files -RUN python manage.py collectstatic_js_reverse -RUN python manage.py collectstatic --noinput +RUN /opt/recipes/venv/bin/python manage.py collectstatic_js_reverse +RUN /opt/recipes/venv/bin/python manage.py collectstatic --noinput # copy the collected static files to a different location, so they can be moved into a potentially mounted volume RUN mv /opt/recipes/staticfiles /opt/recipes/staticfiles-collect # collect information from git repositories -RUN python version.py +RUN /opt/recipes/venv/bin/python version.py # delete git repositories to reduce image size RUN find . -type d -name ".git" | xargs rm -rf diff --git a/boot.sh b/boot.sh index 7d6ec7442..ab5d7fddd 100644 --- a/boot.sh +++ b/boot.sh @@ -1,9 +1,5 @@ #!/bin/sh - -# conditionally activate virtualenv, since the docker container does not need it -if [[ "${DOCKER}" != "true" ]]; then - source venv/bin/activate -fi +source venv/bin/activate TANDOOR_PORT="${TANDOOR_PORT:-8080}" GUNICORN_WORKERS="${GUNICORN_WORKERS:-3}"