File size: 822 Bytes
5c10d72
5b6e4d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61d40de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 #1. Base Image: Use a pre-configured Python environment (like a fresh OS install)
FROM python:3.11-slim

# 2. Setup: Create a folder inside the container to hold your app
WORKDIR /app

# 3. Dependencies: Copy the requirements file first to cache the installation step
# (This makes re-building faster if you only change your code but not libraries)
COPY requirements.txt .

# 4. Install: Run pip to install pandas, streamlit, scikit-learn, etc.
RUN pip install --no-cache-dir -r requirements.txt

# 5. Application Code: Copy all your files (streamlit.py, models, datasets) into the container
COPY . .

# 6. Execution: The command to start the application
# Hugging Face SPECIFIC: You must use port 7860 and address 0.0.0.0
CMD ["streamlit", "run", "flightprice.py", "--server.port", "7860", "--server.address", "0.0.0.0"]