Spaces:
Sleeping
Sleeping
File size: 1,296 Bytes
4481256 f633bc2 df4dc2f 5f30483 8a17d24 a2ce533 df4dc2f abb560d df4dc2f f633bc2 df4dc2f db0584b 6a2d46c db0584b f2bcf68 ada8864 db0584b ada8864 df4dc2f a2ce533 df4dc2f a2ce533 df4dc2f 4481256 a2ce533 |
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 47 48 49 50 |
# Use official Python slim image
FROM python:3.11-slim
# Set environment variables
# Optional: Disable Usage Stats (telemetry) for Privacy / Stability
ENV STREAMLIT_DISABLE_USAGE_STATS=true
# Install dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
build-essential \
curl \
git \
gfortran \
gcc \
g++ \
libopenblas-dev \
liblapack-dev \
ffmpeg \
graphviz \
&& rm -rf /var/lib/apt/lists/*
# switch to a user that works for spaces
# RUN useradd --create-home --uid 1000 --shell /bin/bash user
RUN useradd -m -u 1000 -s /bin/bash user
USER user
# Update PATH to include user base binary directory
ENV HOME=/home/user \
PATH="/home/user/.local/bin:${PATH}"
# Set working directory inside container
WORKDIR /app
# Copy source and requirements (ownership already belongs to user)
COPY --chown=user:user requirements.txt ./
COPY --chown=1000 src/ ./src/
# Install Python dependencies
RUN pip install --no-cache-dir --user -r requirements.txt
# Expose port
EXPOSE 8501
# Health check
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
# Run Streamlit with no browser, on all interfaces
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|