grkavi0912 commited on
Commit
d27f964
·
verified ·
1 Parent(s): 4888697

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a base image with Python
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the requirements file and install dependencies
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ # Copy the application files
12
+ COPY app_flask.py .
13
+ COPY app.py .
14
+ COPY best_random_forest_pipeline.joblib .
15
+
16
+ # Expose the port that your Flask app will run on (Gunicorn default is 8000)
17
+ EXPOSE 8000
18
+
19
+ # Expose the port that your Streamlit app will run on
20
+ EXPOSE 8501
21
+
22
+ # Command to run the application
23
+ # This command starts Gunicorn for the Flask app in the background
24
+ # and then starts the Streamlit app.
25
+ # Note: In a production environment, a process manager like supervisord
26
+ # is recommended for robust process management.
27
+ CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:8000 app_flask:app & streamlit run app.py --server.port 8501 --server.enableCORS false --server.enableXsrfProtection false"]