dynstat commited on
Commit
b06b3f5
·
verified ·
1 Parent(s): 05d8814

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 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.
 
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