Spaces:
Configuration error
Configuration error
Update Dockerfile
Browse files- Dockerfile +14 -18
Dockerfile
CHANGED
|
@@ -1,29 +1,25 @@
|
|
| 1 |
-
|
| 2 |
-
# Use the official Python 3.9 image as the base for the container, providing the Python runtime environment.
|
| 3 |
FROM python:3.9
|
| 4 |
|
| 5 |
-
# Set the working directory inside the container
|
| 6 |
WORKDIR /code
|
| 7 |
|
| 8 |
-
# Copy the requirements.txt file from the host
|
| 9 |
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
|
| 11 |
-
# Install
|
| 12 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 13 |
-
# --no-cache-dir prevents pip from caching packages, reducing the image size.
|
| 14 |
-
# --upgrade ensures that the latest compatible versions of the dependencies are installed.
|
| 15 |
-
# Example: If requirements.txt contains "fastapi==0.70.0", this command will install FastAPI version 0.70.0.
|
| 16 |
|
| 17 |
# Install additional dependencies for audio processing
|
| 18 |
-
RUN apt-get update && apt-get install -y ffmpeg
|
| 19 |
|
| 20 |
-
# Copy all files
|
| 21 |
COPY . /code
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
#
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
#
|
|
|
|
| 1 |
+
# Use the official Python 3.9 image as the base for the container
|
|
|
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
+
# Copy the requirements.txt file from the host
|
| 8 |
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
|
| 10 |
+
# Install Python dependencies
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Install additional dependencies for audio processing
|
| 14 |
+
RUN apt-get update && apt-get install -y ffmpeg && apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# Copy all necessary files into the container
|
| 17 |
COPY . /code
|
| 18 |
+
|
| 19 |
+
# Expose the Uvicorn port
|
| 20 |
+
EXPOSE 7860
|
| 21 |
+
|
| 22 |
+
# Define the default command to run the Uvicorn server
|
| 23 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 24 |
+
|
| 25 |
+
# Optional: Health
|