Spaces:
Sleeping

File size: 1,285 Bytes
a0ac332
 
aaed382
a0ac332
 
8c65069
 
aaed382
8c65069
aaed382
 
a0ac332
 
 
 
 
 
 
8c65069
 
 
aaed382
8c65069
 
a0ac332
8c65069
a0ac332
aaed382
 
 
 
a0ac332
 
aaed382
a0ac332
 
aaed382
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM python:3.9-slim

# Set the working directory
WORKDIR /app

# Set environment variables for Streamlit and Matplotlib cache directories
# This directs Streamlit and Matplotlib to use the /tmp directory for cache/config files
ENV STREAMLIT_HOME="/tmp"
ENV MPLCONFIGDIR="/tmp"

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    && rm -rf /var/lib/apt/lists/*

# Upgrade pip and setuptools to ensure proper package installation and dependency resolution
RUN pip install --no-cache-dir --upgrade pip setuptools

# Copy requirements.txt and install Python dependencies
# Using --no-cache-dir to force fresh downloads and potentially rebuild wheels
# This can help resolve binary incompatibility issues like the numpy.dtype error
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt

# Copy your Streamlit application file to the working directory
COPY app.py ./

# Expose the port Streamlit will run on
EXPOSE 8501

# Healthcheck to ensure the app is running
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

# Define the entrypoint for the application
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]