JibexBanks commited on
Commit
52bb265
·
1 Parent(s): 57b5074

still testing...

Browse files
Files changed (2) hide show
  1. Dockerfile +21 -8
  2. requirements.txt +17 -80
Dockerfile CHANGED
@@ -1,20 +1,33 @@
 
1
  FROM python:3.12-slim
2
 
3
- # Switch to a working directory
 
 
 
 
 
 
 
 
 
 
 
 
4
  WORKDIR /app
5
 
6
- # Copy requirements first to use Docker cache
7
  COPY requirements.txt .
8
 
9
- # Install dependencies (safe & small footprint)
10
- RUN pip install --no-cache-dir --upgrade pip
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Copy the rest of the app
14
  COPY . .
15
 
16
- # Expose port 7860 for Hugging Face Spaces
17
  EXPOSE 7860
18
 
19
- # Command to run FastAPI app
20
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use official Python 3.12 slim image
2
  FROM python:3.12-slim
3
 
4
+ # Set environment variables
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ PIP_NO_CACHE_DIR=1 \
7
+ POETRY_VIRTUALENVS_CREATE=false
8
+
9
+ # Install system dependencies for Python packages
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ build-essential \
12
+ git \
13
+ curl \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Set working directory
17
  WORKDIR /app
18
 
19
+ # Copy only requirements first to leverage Docker cache
20
  COPY requirements.txt .
21
 
22
+ # Upgrade pip and install Python dependencies
23
+ RUN pip install --upgrade pip
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
+ # Copy application code
27
  COPY . .
28
 
29
+ # Expose port for FastAPI / Hugging Face Spaces
30
  EXPOSE 7860
31
 
32
+ # Run FastAPI app with Uvicorn
33
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
requirements.txt CHANGED
@@ -1,88 +1,25 @@
1
- accelerate==0.26.0
2
- aiohappyeyeballs==2.6.1
3
- aiohttp==3.13.2
4
- aiosignal==1.4.0
5
- annotated-types==0.7.0
6
- anyio==3.7.1
7
- attrs==25.4.0
8
- certifi==2025.10.5
9
- cffi==2.0.0
10
- charset-normalizer==3.4.4
11
- click==8.3.0
12
- colorama==0.4.6
13
- cryptography==46.0.3
14
- datasets==2.16.1
15
- deprecation==2.1.0
16
- dill==0.3.7
17
  fastapi==0.104.1
18
- filelock==3.20.0
19
- frozenlist==1.8.0
20
- fsspec==2023.10.0
21
- greenlet==3.2.4
22
- h11==0.16.0
23
- h2==4.3.0
24
- hpack==4.1.0
25
- httpcore==1.0.9
26
- httpx==0.28.1
27
- huggingface-hub==0.20.3
28
- hyperframe==6.1.0
29
- idna==3.11
30
- Jinja2==3.1.6
31
- joblib==1.5.2
32
- MarkupSafe==3.0.3
33
- mpmath==1.3.0
34
- multidict==6.7.0
35
- multiprocess==0.70.15
36
- networkx==3.5
37
- nltk==3.9.1
38
- numpy==1.26.4
39
- packaging==25.0
40
- pandas==2.2.2
41
- Pillow==10.0.1
42
- postgrest==2.24.0
43
- propcache==0.4.1
44
- psutil==7.1.3
45
- psycopg2==2.9.11
46
- pyarrow==22.0.0
47
- pyarrow-hotfix==0.7
48
- pycparser==2.23
49
  pydantic==2.12.4
50
- pydantic_core==2.41.5
51
- PyJWT==2.10.1
52
- python-dateutil==2.9.0.post0
53
  python-dotenv==1.0.1
54
- python-multipart==0.0.6
55
- pytz==2025.2
56
- PyYAML==6.0.3
57
- realtime==2.24.0
58
- regex==2025.11.3
59
  requests==2.32.5
60
- safetensors==0.6.2
61
- scikit-learn==1.3.2
62
- scipy==1.16.3
63
- sentencepiece==0.1.99
64
- six==1.17.0
65
- sniffio==1.3.1
66
- SQLAlchemy==2.0.44
67
- starlette==0.27.0
68
- storage3==2.24.0
69
- StrEnum==0.4.15
70
- supabase==2.24.0
71
- supabase-auth==2.24.0
72
- supabase-functions==2.24.0
73
- sympy==1.14.0
74
- threadpoolctl==3.6.0
75
- tokenizers==0.15.1
76
  torch==2.1.0
77
  torchaudio==2.1.0
78
  torchvision==0.16.0
79
- tqdm==4.67.1
80
  transformers==4.36.2
81
- typing-inspection==0.4.2
82
- typing_extensions==4.15.0
83
- tzdata==2025.2
84
- urllib3==2.5.0
85
- uvicorn[standard]==0.23.2
86
- websockets==15.0.1
87
- xxhash==3.6.0
88
- yarl==1.22.0
 
 
 
 
1
+ # Web / API
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  fastapi==0.104.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  pydantic==2.12.4
 
 
 
4
  python-dotenv==1.0.1
5
+ uvicorn==0.24.0
 
 
 
 
6
  requests==2.32.5
7
+
8
+ # Data / ML
9
+ numpy==1.26.4
10
+ pandas==2.2.2
 
 
 
 
 
 
 
 
 
 
 
 
11
  torch==2.1.0
12
  torchaudio==2.1.0
13
  torchvision==0.16.0
 
14
  transformers==4.36.2
15
+ datasets==2.16.1
16
+ scikit-learn==1.3.2
17
+ Pillow==10.0.1
18
+
19
+ # Hugging Face / ML utilities
20
+ tqdm==4.67.1
21
+ sentencepiece==0.1.99
22
+ regex==2025.11.3
23
+ pyyaml==6.0.3
24
+ joblib==1.5.2
25
+ typing_extensions==4.15.0