sairamv1 commited on
Commit
97b75e6
·
verified ·
1 Parent(s): 069dcea

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -9
Dockerfile CHANGED
@@ -1,15 +1,23 @@
1
- # Use a lightweight Python image
2
  FROM python:3.10-slim
3
 
4
- # Set the working directory
5
  WORKDIR /code
6
 
7
- # Copy requirements and install
8
- COPY ./requirements.txt /code/requirements.txt
9
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
10
 
11
- # Copy the rest of your app code
12
- COPY . .
13
 
14
- # Start the FastAPI server on port 7860 (HF's default port)
15
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /code
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ libgomp1 \
8
+ && rm -rf /var/lib/apt/lists/*
9
 
10
+ COPY requirements.txt /code/requirements.txt
 
11
 
12
+ RUN pip install --no-cache-dir --upgrade pip && \
13
+ pip install --no-cache-dir -r /code/requirements.txt
14
+
15
+ COPY app.py /code/app.py
16
+
17
+ # Create tmp directory for HuggingFace cache
18
+ RUN mkdir -p /tmp/huggingface
19
+
20
+ # Expose port 7860 (HuggingFace Spaces default)
21
+ EXPOSE 7860
22
+
23
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]