Skip to content

Commit

Permalink
Remove redundant packages
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Sep 3, 2024
1 parent 88b9c08 commit a403950
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ 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
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=""
Expand All @@ -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 \
Expand Down

0 comments on commit a403950

Please sign in to comment.