|
FROM python:3.10 |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
build-essential \ |
|
curl \ |
|
software-properties-common \ |
|
git \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN mkdir -p /home/appuser/.streamlit && \ |
|
mkdir -p /home/appuser/.config/matplotlib && \ |
|
chmod -R 777 /home/appuser |
|
|
|
|
|
ENV MPLCONFIGDIR=/home/appuser/.config/matplotlib |
|
ENV STREAMLIT_GLOBAL_DEVELOPMENT_MODE=false |
|
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false |
|
|
|
|
|
COPY requirements.txt ./ |
|
COPY src/ ./src/ |
|
|
|
|
|
RUN pip3 install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN useradd -m appuser && chown -R appuser:appuser /app |
|
USER appuser |
|
|
|
EXPOSE 8501 |
|
|
|
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health |
|
|
|
ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0"] |