Spaces:
Sleeping
Sleeping
- Dockerfile +13 -6
Dockerfile
CHANGED
@@ -1,18 +1,25 @@
|
|
1 |
FROM python:3.12-slim
|
2 |
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
portaudio19-dev \
|
8 |
-
&& rm -rf /var/lib/apt/lists/*
|
9 |
|
10 |
-
|
|
|
11 |
|
|
|
|
|
12 |
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
|
|
|
14 |
COPY . .
|
15 |
|
|
|
16 |
EXPOSE 7860
|
17 |
|
|
|
18 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
FROM python:3.12-slim
|
2 |
|
3 |
+
# Set environment variables to prevent Python from writing pyc files to disk
|
4 |
+
# and to force stdout and stderr streams to be unbuffered
|
5 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
6 |
+
ENV PYTHONUNBUFFERED=1
|
7 |
|
8 |
+
# Install FFmpeg
|
9 |
+
RUN apt-get update && apt-get install -y ffmpeg
|
|
|
|
|
10 |
|
11 |
+
# Create and set the working directory
|
12 |
+
WORKDIR /app
|
13 |
|
14 |
+
# Copy the requirements.txt file and install the Python dependencies
|
15 |
+
COPY requirements.txt .
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
+
# Copy the rest of the application code
|
19 |
COPY . .
|
20 |
|
21 |
+
# Expose the port that the FastAPI app runs on
|
22 |
EXPOSE 7860
|
23 |
|
24 |
+
# Run the FastAPI application with Uvicorn
|
25 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|