feat: re-add venv

This commit is contained in:
tooboredtocode
2024-03-22 19:04:29 +01:00
parent 7bfa23b953
commit 20b812c2cc
2 changed files with 9 additions and 12 deletions

View File

@@ -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

View File

@@ -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}"