-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|