Sameer-Handsome173 commited on
Commit
21037ed
·
verified ·
1 Parent(s): 77ec054

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.10 slim image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ build-essential \
10
+ curl \
11
+ software-properties-common \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Copy requirements first for better caching
15
+ COPY requirements.txt .
16
+
17
+ # Install Python dependencies
18
+ RUN pip install --no-cache-dir --upgrade pip && \
19
+ pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Copy application code
22
+ COPY app.py .
23
+
24
+ # Expose Streamlit port
25
+ EXPOSE 7860
26
+
27
+ # Health check
28
+ HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
29
+
30
+ # Set environment variables for Streamlit
31
+ ENV STREAMLIT_SERVER_PORT=7860
32
+ ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
33
+ ENV STREAMLIT_SERVER_HEADLESS=true
34
+ ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
35
+
36
+ # Run the application
37
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]