alaselababatunde commited on
Commit
02b3d0d
·
1 Parent(s): e58a643
Files changed (2) hide show
  1. Dockerfile +7 -31
  2. requirements.txt +10 -7
Dockerfile CHANGED
@@ -1,8 +1,8 @@
1
  # ==============================================================
2
- # Tech Disciples AI Backend — Dockerfile (Optimized)
3
  # ==============================================================
4
 
5
- # Use official Python 3.10 slim image
6
  FROM python:3.10-slim
7
 
8
  # Set environment variables
@@ -10,49 +10,25 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
10
  PYTHONUNBUFFERED=1 \
11
  APP_HOME=/app
12
 
13
- # Set working directory
14
  WORKDIR $APP_HOME
15
 
16
- # -------------------------
17
  # System dependencies
18
- # -------------------------
19
- RUN apt-get update && apt-get install -y --no-install-recommends \
20
  git \
21
- curl \
22
- build-essential \
23
  && rm -rf /var/lib/apt/lists/*
24
 
25
- # -------------------------
26
- # Upgrade pip & essential build tools
27
- # -------------------------
28
- RUN pip install --upgrade pip setuptools wheel
29
-
30
- # -------------------------
31
- # Install PyTorch (CPU-only)
32
- # -------------------------
33
- RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
34
-
35
- # -------------------------
36
- # Copy requirements file first (for caching)
37
- # -------------------------
38
  COPY requirements.txt .
39
 
40
- # -------------------------
41
  # Install Python dependencies
42
- # -------------------------
43
  RUN pip install --no-cache-dir -r requirements.txt
44
 
45
- # -------------------------
46
- # Copy app code
47
- # -------------------------
48
  COPY . .
49
 
50
- # -------------------------
51
- # Expose FastAPI port
52
- # -------------------------
53
  EXPOSE 7860
54
 
55
- # -------------------------
56
  # Run the FastAPI app with Uvicorn
57
- # -------------------------
58
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # ==============================================================
2
+ # Tech Disciples AI Backend — Dockerfile
3
  # ==============================================================
4
 
5
+ # Use lightweight official Python image
6
  FROM python:3.10-slim
7
 
8
  # Set environment variables
 
10
  PYTHONUNBUFFERED=1 \
11
  APP_HOME=/app
12
 
13
+ # Set work directory
14
  WORKDIR $APP_HOME
15
 
 
16
  # System dependencies
17
+ RUN apt-get update && apt-get install -y \
 
18
  git \
 
 
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
+ # Copy requirement file first (for caching)
 
 
 
 
 
 
 
 
 
 
 
 
22
  COPY requirements.txt .
23
 
 
24
  # Install Python dependencies
 
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
+ # Copy application files
 
 
28
  COPY . .
29
 
30
+ # Expose port for FastAPI
 
 
31
  EXPOSE 7860
32
 
 
33
  # Run the FastAPI app with Uvicorn
 
34
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
@@ -1,7 +1,10 @@
1
- fastapi>=0.101.0
2
- uvicorn[standard]>=0.23.0
3
- transformers>=4.40.0
4
- accelerate>=0.25.0
5
- langchain>=1.0.0
6
- huggingface-hub>=1.30.0
7
- pydantic>=1.10.10
 
 
 
 
1
+ fastapi
2
+ uvicorn[standard]
3
+ torch
4
+ transformers
5
+ accelerate
6
+ langchain
7
+ langchain-community
8
+ huggingface-hub
9
+ pydantic
10
+ langchain-core