|
|
|
|
|
|
|
FROM python:3.9 |
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
ENV PATH="/home/user/.local/bin:$PATH" |
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY app.py . |
|
COPY models/best.pt ./models/best.pt |
|
|
|
COPY --chown=user ./requirements.txt requirements.txt |
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
libgl1-mesa-glx \ |
|
libglib2.0-0 \ |
|
curl \ |
|
supervisor \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN curl -fsSL https://ollama.ai/install.sh | sh && \ |
|
apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
COPY --chown=user . /app |
|
|
|
|
|
EXPOSE 8501 |
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
|
CMD curl --fail http://localhost:8501/_stcore/health || exit 1 |
|
|
|
|
|
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] |