yifan0sun commited on
Commit
c0adfb1
·
1 Parent(s): 6e5335f

dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -9
Dockerfile CHANGED
@@ -1,21 +1,19 @@
1
- # Use lightweight Python image
2
  FROM python:3.10-slim
3
 
4
- # Install system dependencies
5
  RUN apt-get update && apt-get install -y git && apt-get clean
6
 
7
- # Set working directory
8
- WORKDIR /app
9
 
10
- # Copy requirements and install them
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
- # Copy the rest of the backend code
15
  COPY . .
16
 
17
- # Expose the port expected by Hugging Face Spaces (7860 or 8000 both work)
18
  EXPOSE 7860
19
 
20
- # Run FastAPI app using Uvicorn
21
- CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  RUN apt-get update && apt-get install -y git && apt-get clean
4
 
5
+ # Set working directory to root of copied repo
6
+ WORKDIR /
7
 
8
+ # Install dependencies
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
+ # Copy everything from the repo root into the container root
13
  COPY . .
14
 
15
+ # Expose port for Hugging Face
16
  EXPOSE 7860
17
 
18
+ # Launch server.py's FastAPI app
19
+ CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]