Skip to content

Commit

Permalink
Jenkins removed && Dockerfile modified
Browse files Browse the repository at this point in the history
  • Loading branch information
hlebkanonik committed Dec 7, 2023
1 parent c580eb9 commit 7460bcd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 219 deletions.
17 changes: 6 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,24 @@ RUN mkdir /backend \


FROM --platform=${BUILDPLATFORM} python:3.10.13-slim
WORKDIR /backend/
COPY --from=builder /backend ./
COPY --from=builder /venv /venv
COPY --from=builder /usr/share/nltk_data /usr/share/nltk_data/
RUN apt-get update && apt-get -y upgrade \
&& apt-get install -y libxml2 libgomp1 curl libpcre3 libpcre3-dev \
&& rm -rf /var/lib/apt/lists/*

# Create a group and user
RUN groupadd uwsgi && useradd -g uwsgi uwsgi
RUN chown -R uwsgi: /usr/share/nltk_data && \
chown -R uwsgi: /backend
USER uwsgi

COPY --from=builder /venv /venv
RUN mkdir /usr/share/nltk_data && chmod g+w /usr/share/nltk_data
COPY --from=builder /usr/share/nltk_data /usr/share/nltk_data/
WORKDIR /backend/
COPY --from=builder /backend ./

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 \
UWSGI_VIRTUALENV=${VIRTUAL_ENV} UWSGI_MASTER=1 UWSGI_WORKERS=4 UWSGI_THREADS=8 UWSGI_MAX_FD=10000 UWSGI_LAZY_APPS=1 \
UWSGI_WSGI_ENV_BEHAVIOR=holy PYTHONDONTWRITEBYTECODE=1

# Start uWSGI
CMD ["/venv/bin/uwsgi", "--http-auto-chunked", "--http-keepalive"]
HEALTHCHECK --interval=1m --timeout=5s --retries=2 CMD ["curl", "-s", "-f", "--show-error", "http://localhost:5001/"]
37 changes: 0 additions & 37 deletions Jenkinsfile

This file was deleted.

47 changes: 0 additions & 47 deletions Jenkinsfile-candidate

This file was deleted.

98 changes: 0 additions & 98 deletions Jenkinsfile.k8s.groovy

This file was deleted.

26 changes: 0 additions & 26 deletions JenkinsfileRelease

This file was deleted.

0 comments on commit 7460bcd

Please sign in to comment.