Spaces:
Running
Running
File size: 978 Bytes
064a6b6 cbaa929 b2373ce 064a6b6 cbaa929 b2373ce cbaa929 b2373ce 064a6b6 79d27e8 064a6b6 b2373ce 064a6b6 b2373ce cbaa929 064a6b6 b2373ce 064a6b6 |
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 39 40 41 42 43 44 45 46 |
# Base image
FROM python:3.10-slim
# Set environment variables
ENV HOME=/app
ENV STREAMLIT_HOME=/app/.streamlit
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy app files
COPY requirements.txt .
COPY app.py .
# Install Python dependencies
RUN pip install --upgrade pip && \
pip install -r requirements.txt
# Create a writable .streamlit directory
RUN mkdir -p $STREAMLIT_HOME
# Optional: basic Streamlit config to avoid warnings
RUN echo "\
[server]\n\
headless = true\n\
enableCORS = false\n\
port = 8501\n\
" > $STREAMLIT_HOME/config.toml
# Expose Streamlit port
EXPOSE 8501
# Health check
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
# Start the Streamlit app
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|