Satyam0077 commited on
Commit
d9d31be
·
verified ·
1 Parent(s): 2e10b84

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -8
Dockerfile CHANGED
@@ -4,20 +4,27 @@ FROM python:3.9-slim
4
  # Set working directory inside container
5
  WORKDIR /app
6
 
7
- # Install system dependencies (optional but recommended)
8
- RUN apt-get update && apt-get install -y \
9
  build-essential \
10
- curl \
11
- software-properties-common \
12
  git \
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Copy requirements.txt and install Python dependencies
16
  COPY requirements.txt ./
 
 
 
 
 
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy all files from your repo root into /app in the container
20
  COPY . .
21
 
22
- # Command to run the Streamlit app on port 7860 and listen on all interfaces
23
- CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
 
 
 
4
  # Set working directory inside container
5
  WORKDIR /app
6
 
7
+ # Install system dependencies (build essentials, git, curl, etc.)
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
  build-essential \
 
 
10
  git \
11
+ curl \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Copy only requirements.txt first for better caching
15
  COPY requirements.txt ./
16
+
17
+ # Upgrade pip to latest to avoid some install issues
18
+ RUN pip install --upgrade pip
19
+
20
+ # Install Python dependencies
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
+ # Copy the rest of your app files after dependencies installed
24
  COPY . .
25
 
26
+ # Expose the port (optional but good practice)
27
+ EXPOSE 7860
28
+
29
+ # Run Streamlit app on 0.0.0.0 to be accessible externally, port 7860
30
+ CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]