mimo1972 commited on
Commit
5b6e4d0
·
verified ·
1 Parent(s): 40ecbe3

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -0
Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 1. Base Image: Use a pre-configured Python environment (like a fresh OS install)
2
+ FROM python:3.11-slim
3
+
4
+ # 2. Setup: Create a folder inside the container to hold your app
5
+ WORKDIR /app
6
+
7
+ # 3. Dependencies: Copy the requirements file first to cache the installation step
8
+ # (This makes re-building faster if you only change your code but not libraries)
9
+ COPY requirements.txt .
10
+
11
+ # 4. Install: Run pip to install pandas, streamlit, scikit-learn, etc.
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # 5. Application Code: Copy all your files (streamlit.py, models, datasets) into the container
15
+ COPY . .
16
+
17
+ # 6. Execution: The command to start the application
18
+ # Hugging Face SPECIFIC: You must use port 7860 and address 0.0.0.0
19
+ CMD ["streamlit", "run", "flightprice.py", "--server.port", "7860", "--server.address", "0.0.0.0"]