Sriranjan commited on
Commit
7191a2a
·
1 Parent(s): ee44c8b

Add git installation to Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -18
Dockerfile CHANGED
@@ -1,29 +1,25 @@
 
1
  FROM python:3.9-slim
2
 
3
- WORKDIR /app
 
4
 
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- git \
8
- build-essential \
9
- && rm -rf /var/lib/apt/lists/*
10
 
11
- # Copy requirements first (for caching)
12
  COPY requirements.txt .
13
-
14
- # Install Python dependencies
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy app files
18
  COPY . .
19
 
20
- # Expose Streamlit port
21
- EXPOSE 8501
 
22
 
23
- # Streamlit config
24
- ENV STREAMLIT_SERVER_HEADLESS=true
25
- ENV STREAMLIT_SERVER_ENABLECORS=false
26
- ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false
27
 
28
- # Run Streamlit app
29
- CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
+ # Use the official Python 3.9 slim image
2
  FROM python:3.9-slim
3
 
4
+ # 1. Install git (This fixes the /bin/sh: git: not found error!)
5
+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
6
 
7
+ # 2. Set the working directory
8
+ WORKDIR /app
 
 
 
9
 
10
+ # 3. Install Python dependencies
11
  COPY requirements.txt .
 
 
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # 4. Copy the rest of your files
15
  COPY . .
16
 
17
+ # 5. Force Streamlit to use the correct port
18
+ RUN mkdir -p ~/.streamlit && \
19
+ echo "[server]\nport = 7860\naddress = \"0.0.0.0\"\n" > ~/.streamlit/config.toml
20
 
21
+ # 6. Expose port 7860
22
+ EXPOSE 7860
 
 
23
 
24
+ # 7. Run the app
25
+ CMD ["streamlit", "run", "app.py"]