praneeth232 commited on
Commit
ca397da
·
verified ·
1 Parent(s): 728a577

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -1,17 +1,14 @@
1
- # Use the official slim Python 3.9 image as the base image
2
- FROM python:3.9-slim
3
 
4
- # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
- # Copy all files from the current directory to the container's working directory
 
 
8
  COPY . .
9
 
10
- # Install dependencies from the requirements file without using cache to reduce image size
11
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
12
 
13
- # Define the command to start the application using Gunicorn with 4 worker processes
14
- # - `-w 4`: Uses 4 worker processes for handling requests
15
- # - `-b 0.0.0.0:7860`: Binds the server to port 7860 on all network interfaces
16
- # - `app:app`: Runs the Flask app (assuming `app.py` contains the Flask instance named `app`)
17
- CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
 
1
+ FROM python:3.9
 
2
 
 
3
  WORKDIR /app
4
 
5
+ COPY requirements.txt .
6
+ RUN pip install --no-cache-dir -r requirements.txt
7
+
8
  COPY . .
9
 
10
+ EXPOSE 7860
 
11
 
12
+ # Run Gunicorn for Flask in background, Streamlit in foreground
13
+ CMD gunicorn -b 0.0.0.0:8000 app:app & \
14
+ streamlit run main.py --server.port=7860 --server.address=0.0.0.0