Muhammad Saad commited on
Commit
e419834
·
1 Parent(s): f4990f7
Files changed (1) hide show
  1. DockerFile +12 -10
DockerFile CHANGED
@@ -1,16 +1,18 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.12
 
5
 
6
- RUN useradd -m -u 1000 user
7
- USER user
8
- ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
- WORKDIR /app
 
11
 
12
- COPY --chown=user ./requirements.txt requirements.txt
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
- COPY --chown=user . /app
16
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Base image
2
+ FROM python:3.11-slim
3
 
4
+ # Set work directory
5
+ WORKDIR /app
6
 
7
+ # Install dependencies
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Copy project files
12
+ COPY . .
13
 
14
+ # Expose the port Hugging Face expects
15
+ EXPOSE 7860
16
 
17
+ # Command to run FastAPI with uvicorn
18
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]