entropy25 commited on
Commit
5e4e679
·
verified ·
1 Parent(s): 508897e

Create Dockerfile

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