Spaces:
Sleeping
Sleeping
Create dockerfile
Browse files- dockerfile +30 -0
dockerfile
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Dockerfile
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# System dependencies
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
graphviz \
|
7 |
+
libgl1-mesa-glx \
|
8 |
+
libglib2.0-0 \
|
9 |
+
&& rm -rf /var/lib/apt/lists/*
|
10 |
+
|
11 |
+
# Set working directory
|
12 |
+
WORKDIR /app
|
13 |
+
|
14 |
+
# Copy requirements first to leverage Docker cache
|
15 |
+
COPY requirements.txt .
|
16 |
+
|
17 |
+
# Install Python dependencies
|
18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
+
|
20 |
+
# Copy application files
|
21 |
+
COPY . .
|
22 |
+
|
23 |
+
# Expose Streamlit port
|
24 |
+
EXPOSE 8501
|
25 |
+
|
26 |
+
# Healthcheck for HF Spaces
|
27 |
+
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
28 |
+
|
29 |
+
# Run the app
|
30 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|