Skip to content

Commit 52c49fd

Browse files
committed
tested docter locally and pushed to dockerhub
1 parent 2eb49b6 commit 52c49fd

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,5 @@ dataset/
211211
*.pkl
212212
creds.txt
213213
workflow.txt
214-
local_s3/
214+
local_s3/
215+
notes/

dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# 1. Base image
2+
FROM python:3.12-slim
3+
4+
# 2. Environment variables
5+
ENV PYTHONDONTWRITEBYTECODE=1 \
6+
PYTHONUNBUFFERED=1
7+
8+
# 3. Set working directory
9+
WORKDIR /app
10+
11+
# 4. Install system dependencies (only if needed)
12+
RUN apt-get update && apt-get install -y --no-install-recommends \
13+
build-essential \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
# 5. Install uv
17+
RUN pip install --no-cache-dir uv
18+
19+
# 6. only Flask app requirements first (better caching)
20+
COPY flask_app/requirements.txt ./requirements.txt
21+
22+
# 7. Install dependencies using uv
23+
RUN uv pip install --system --no-cache -r requirements.txt
24+
25+
# 8. Download NLTK data
26+
RUN python -m nltk.downloader stopwords wordnet
27+
28+
# 9. Copy application code
29+
COPY flask_app/ .
30+
31+
# 10. Copy model artifact
32+
COPY models/vectorizer.pkl ./models/vectorizer.pkl
33+
34+
# 11. Expose port
35+
EXPOSE 5000
36+
37+
# local
38+
CMD ["python", "app.py"]
39+
40+
# 12. Run app (production)
41+
# CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--timeout", "120", "app:app"]

flask_app/requirements.txt

126 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)