trixy194t commited on
Commit
df79ac0
·
verified ·
1 Parent(s): ffa6eb2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -7
Dockerfile CHANGED
@@ -1,21 +1,25 @@
1
- # Use a lightweight Python image
2
  FROM python:3.9-slim
3
 
4
- # Set the working directory inside the container
5
  WORKDIR /code
6
 
7
- # Install system dependencies required for librosa and audio processing
8
  RUN apt-get update && apt-get install -y \
9
  libsndfile1 \
10
  ffmpeg \
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Copy requirements and install Python libraries
14
  COPY ./requirements.txt /code/requirements.txt
15
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
16
 
17
- # Copy the rest of your application code
18
  COPY . .
19
 
20
- # Command to run the FastAPI app on port 7860
21
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
1
+ # Use an official lightweight Python image
2
  FROM python:3.9-slim
3
 
4
+ # Set working directory
5
  WORKDIR /code
6
 
7
+ # Install system dependencies for audio processing
8
  RUN apt-get update && apt-get install -y \
9
  libsndfile1 \
10
  ffmpeg \
11
+ curl \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Copy requirements first to leverage Docker cache
15
  COPY ./requirements.txt /code/requirements.txt
16
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
17
 
18
+ # Copy the application code and model
19
  COPY . .
20
 
21
+ # Expose the port FastAPI runs on
22
+ EXPOSE 7860
23
+
24
+ # Run with 1 worker to maximize RAM availability per request
25
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]