Skip to content

Commit

Permalink
debug cicd.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
2003HARSH committed Nov 11, 2024
1 parent b542a10 commit 0675b83
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ jobs:
aws ecr get-login-password --region eu-north-1 | docker login --username AWS --password-stdin 843369994444.dkr.ecr.eu-north-1.amazonaws.com
docker pull 843369994444.dkr.ecr.eu-north-1.amazonaws.com/text-classification:latest
# docker stop text-classification || true
# docker rm text-classification || true
sudo docker run -d -p 80:5000 -e DAGSHUB_PAT= ${{ secrets.DAGSHUB_PAT }} --name text-classification 843369994444.dkr.ecr.eu-north-1.amazonaws.com/text-classification:latest
docker stop text-classification || true
docker rm text-classification || true
docker run -d -p 80:5000 -e DAGSHUB_PAT=${{ secrets.DAGSHUB_PAT }} --name text-classification 843369994444.dkr.ecr.eu-north-1.amazonaws.com/text-classification:latest
23 changes: 18 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
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

RUN python -m nltk.downloader stopwords wordnet
#copy only neccesary files from the build stage
COPY --from=build /app /app

EXPOSE 5000

CMD ["gunicorn","-b","0.0.0.0:5000","app:app"]
CMD ["gunicorn","--bind","0.0.0.0:5000","--timeout","120","app:app"]

0 comments on commit 0675b83

Please sign in to comment.