diff --git a/Dockerfile b/Dockerfile index 780daa18..94cd2cca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,9 @@ RUN make test-all FROM --platform=${BUILDPLATFORM} registry.access.redhat.com/ubi8/python-311:latest AS builder USER root RUN dnf -y upgrade && dnf -y install pcre-devel \ + && dnf -y remove emacs-filesystem libjpeg-turbo libtiff libpng wget \ + && dnf -y autoremove \ + && dnf clean all \ && python -m venv /venv \ && mkdir /build ENV VIRTUAL_ENV=/venv @@ -23,6 +26,7 @@ ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" WORKDIR /build COPY ./ ./ RUN "${VIRTUAL_ENV}/bin/pip" install --upgrade pip \ + && "${VIRTUAL_ENV}/bin/pip" install --upgrade setuptools \ && LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "${VIRTUAL_ENV}/bin/pip install --no-cache-dir -r requirements.txt" \ && "${VIRTUAL_ENV}/bin/python3" -m nltk.downloader -d /usr/share/nltk_data stopwords ARG APP_VERSION="" @@ -40,19 +44,19 @@ WORKDIR /backend/ COPY --from=builder /backend ./ COPY --from=builder /venv /venv COPY --from=builder /usr/share/nltk_data /usr/share/nltk_data/ -ENV VIRTUAL_ENV="/venv" RUN dnf -y upgrade && dnf -y install libgomp pcre-devel \ && dnf -y remove emacs-filesystem libjpeg-turbo libtiff libpng wget \ && dnf -y autoremove \ && dnf clean all \ - && "${VIRTUAL_ENV}/bin/pip" install --upgrade pip \ - && "${VIRTUAL_ENV}/bin/pip" install --upgrade setuptools \ + && pip install --upgrade pip \ + && pip install --upgrade setuptools \ && mkdir -p -m 0700 /backend/storage \ && groupadd uwsgi && useradd -g uwsgi uwsgi \ && chown -R uwsgi: /usr/share/nltk_data \ && chown -R uwsgi: /backend USER uwsgi EXPOSE 5001 +ENV VIRTUAL_ENV="/venv" # uWSGI configuration (customize as needed): ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" PYTHONPATH=/backend \ FLASK_APP=app/main.py UWSGI_WSGI_FILE=app/main.py UWSGI_SOCKET=:3031 UWSGI_HTTP=:5001 \