usmanyousaf commited on
Commit
4232e48
·
verified ·
1 Parent(s): 47e60c5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -9
Dockerfile CHANGED
@@ -3,19 +3,21 @@ FROM python:3.10-slim
3
  # Set working directory
4
  WORKDIR /app
5
 
6
- # Copy application files
7
- COPY . /app
8
-
9
  # Install system dependencies
10
  RUN apt-get update && apt-get install -y \
11
- gcc \
12
- libsndfile1 \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Install Python dependencies
16
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
17
 
 
18
  EXPOSE 7860
19
 
20
- # Use gunicorn to run the app
21
- CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
 
3
  # Set working directory
4
  WORKDIR /app
5
 
 
 
 
6
  # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
+ build-essential \
9
+ libpq-dev \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Copy the current directory contents into the container at /app
13
+ COPY . /app
14
+
15
+ # Install the required Python packages
16
+ RUN pip install --upgrade pip
17
+ RUN pip install -r requirements.txt
18
 
19
+ # Expose the port Hugging Face Spaces expects
20
  EXPOSE 7860
21
 
22
+ # Command to run the FastAPI app on Hugging Face Spaces
23
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]