|
FROM python:3.10-slim |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y --no-install-recommends \ |
|
build-essential \ |
|
gcc \ |
|
libgomp1 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY requirements.txt . |
|
RUN pip install --upgrade pip && \ |
|
pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN which streamlit && streamlit --version |
|
|
|
|
|
COPY . . |
|
|
|
|
|
RUN useradd -m appuser && chown -R appuser:appuser /app |
|
USER appuser |
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ |
|
CMD curl -f http://localhost:7860/health || exit 1 |
|
|
|
|
|
CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=7860"] |