Skip to content

Commit 0675b83

Browse files
committed
debug cicd.yaml
1 parent b542a10 commit 0675b83

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

.github/workflows/cicd.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ jobs:
9090
aws ecr get-login-password --region eu-north-1 | docker login --username AWS --password-stdin 843369994444.dkr.ecr.eu-north-1.amazonaws.com
9191
9292
docker pull 843369994444.dkr.ecr.eu-north-1.amazonaws.com/text-classification:latest
93-
# docker stop text-classification || true
94-
# docker rm text-classification || true
95-
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
93+
docker stop text-classification || true
94+
docker rm text-classification || true
95+
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

Dockerfile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1-
FROM python:3.10-slim
1+
#multistage build to reduce image size
2+
3+
FROM python:3.10 AS build
24

35
WORKDIR /app
46

5-
COPY flask_app/ /app/
7+
COPY flask_app/requirements.txt /app/
68

9+
#install only neccessary libraries
10+
RUN pip install --no-cache-dir -r requirements.txt
11+
12+
COPY flask_app/ /app/
713
COPY models/vectorizer.pkl /app/models/vectorizer.pkl
814

9-
RUN pip install -r requirements.txt
15+
RUN python -m nltk.downloader stopwords wordnet
16+
17+
#--------------------------------------------------------------------------------------------
18+
19+
FROM python:3.10-slim AS final
20+
21+
WORKDIR /app
1022

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

1326
EXPOSE 5000
1427

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

0 commit comments

Comments
 (0)