Update Dockerfile
Browse files- Dockerfile +11 -7
Dockerfile
CHANGED
|
@@ -1,21 +1,25 @@
|
|
| 1 |
-
# Use
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Set
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
-
# Install system dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
libsndfile1 \
|
| 10 |
ffmpeg \
|
|
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Copy requirements
|
| 14 |
COPY ./requirements.txt /code/requirements.txt
|
| 15 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 16 |
|
| 17 |
-
# Copy the
|
| 18 |
COPY . .
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|