aursalan commited on
Commit
0ba244a
·
1 Parent(s): a243c57

Changed docker file

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -5
Dockerfile CHANGED
@@ -1,13 +1,25 @@
1
- FROM python:3.12
2
 
3
- WORKDIR /code
 
4
 
5
- COPY ./requirements.txt /code/requirements.txt
 
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
8
 
 
 
 
 
9
  COPY . .
10
 
 
11
  EXPOSE 7860
12
 
13
- CMD ["shiny", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
1
+ # Dockerfile
2
 
3
+ # Use an official Python runtime as a parent image
4
+ FROM python:3.12-slim
5
 
6
+ # Set the working directory in the container
7
+ WORKDIR /app
8
 
9
+ # Copy the requirements file into the container
10
+ COPY requirements.txt .
11
 
12
+ # Install any needed packages specified in requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ # Copy the rest of the application's code into the container
16
  COPY . .
17
 
18
+ # Make port 7860 available to the world outside this container
19
  EXPOSE 7860
20
 
21
+ # Command to run the application using Gunicorn
22
+ # This is a robust way to run FastAPI/Flask in production.
23
+ # It starts 4 worker processes to handle requests.
24
+ # The app:app part refers to the file 'app.py' and the FastAPI instance 'app'.
25
+ CMD ["gunicorn", "--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:7860", "app:app"]