Spaces:
Running
Running
File size: 816 Bytes
749787c 59a7257 749787c 59a7257 749787c a86176a 59a7257 a86176a 1a6ba0c 59a7257 a86176a 59a7257 1a6ba0c 749787c 59a7257 749787c 1a6ba0c |
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 |
FROM python:3.9-slim
RUN groupadd --gid 1000 appuser && \
useradd --uid 1000 --gid 1000 -ms /bin/bash appuser
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt ./
COPY src/ ./src/
RUN pip install --no-cache-dir -r requirements.txt
ENV HOME=/app
# Create .streamlit config and set permissions
RUN mkdir -p /app/.streamlit && \
echo "[server]\n\
enableCORS = false\n\
enableXsrfProtection = false\n\
" > /app/.streamlit/config.toml && \
chown -R appuser:appuser /app /app/.streamlit
USER appuser
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|