Spaces:
Configuration error
Configuration error
Update Dockerfile
Browse files- Dockerfile +28 -25
Dockerfile
CHANGED
|
@@ -1,26 +1,29 @@
|
|
| 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 to /code where all subsequent commands will be executed.
|
| 6 |
-
WORKDIR /code
|
| 7 |
-
|
| 8 |
-
# Copy the requirements.txt file from the host to the /code directory in the container. This file lists all the Python dependencies needed for the application.
|
| 9 |
-
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
-
|
| 11 |
-
# Install the Python dependencies specified in requirements.txt using pip.
|
| 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 |
-
#
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
# Example: Running this command starts the web server, allowing users to access the Telegram Voice Transcription Bot via port 7860.
|
|
|
|
| 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 to /code where all subsequent commands will be executed.
|
| 6 |
+
WORKDIR /code
|
| 7 |
+
|
| 8 |
+
# Copy the requirements.txt file from the host to the /code directory in the container. This file lists all the Python dependencies needed for the application.
|
| 9 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
+
|
| 11 |
+
# Install the Python dependencies specified in requirements.txt using pip.
|
| 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 from the current directory on the host machine into the /code directory inside the container.
|
| 21 |
+
COPY . /code
|
| 22 |
+
# This includes the application code, configuration files, and any other necessary resources.
|
| 23 |
+
|
| 24 |
+
# Define the default command to run when the container starts.
|
| 25 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 26 |
+
# This command launches the Uvicorn server to serve the FastAPI application defined in app.py.
|
| 27 |
+
# --host "0.0.0.0" makes the server accessible externally.
|
| 28 |
+
# --port "7860" sets the port on which the application will listen.
|
| 29 |
# Example: Running this command starts the web server, allowing users to access the Telegram Voice Transcription Bot via port 7860.
|