waliullah123 commited on
Commit
4d2bd8b
·
verified ·
1 Parent(s): 29f4cca

Add Dockerfile to trigger Docker Space build

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Create a non-root user (required by Hugging Face Spaces)
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV HOME=/home/user \
7
+ PATH=/home/user/.local/bin:$PATH
8
+
9
+ WORKDIR /home/user/app
10
+
11
+ # Install dependencies
12
+ COPY --chown=user requirements.txt ./requirements.txt
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Download NLTK data required by feature_extraction.py
16
+ RUN python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('wordnet'); nltk.download('punkt_tab')"
17
+
18
+ # Copy application files
19
+ COPY --chown=user . ./
20
+
21
+ # Hugging Face Spaces exposes port 7860
22
+ EXPOSE 7860
23
+ ENV PORT=7860
24
+
25
+ # Run with gunicorn for production
26
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "300", "app:app"]