Skip to content

Commit

Permalink
Resolved bugs in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
2003HARSH committed Nov 11, 2024
1 parent c507738 commit e1deb2e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
25 changes: 20 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
FROM python:3.10-slim
#multistage build to reduce image size

FROM python:3.10 AS build

WORKDIR /app

COPY flask_app/ /app/
COPY flask_app/requirements.txt /app/

#install only neccessary libraries
RUN pip install --no-cache-dir -r requirements.txt

COPY flask_app/ /app/
COPY models/vectorizer.pkl /app/models/vectorizer.pkl

RUN pip install -r requirements.txt
RUN python -m nltk.downloader stopwords wordnet

#--------------------------------------------------------------------------------------------

FROM python:3.10-slim AS final

WORKDIR /app

#copy only neccesary files from the build stage
COPY --from=build /app /app

RUN python -m nltk.downloader stopwords wordnet
RUN pip install gunicorn

EXPOSE 5000

CMD ["python","app.py"]
CMD ["gunicorn","--bind","0.0.0.0:5000","--timeout","120","app:app"]
1 change: 1 addition & 0 deletions flask_app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
gunicorn
Flask==3.0.3
mlflow==2.15.1
mlflow_skinny==2.15.1
Expand Down

0 comments on commit e1deb2e

Please sign in to comment.