|
FROM python:3.9-slim |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN mkdir -p /app/.cache && \ |
|
mkdir -p /app/configs && \ |
|
chmod -R 777 /app/.cache && \ |
|
chmod -R 777 /app/configs |
|
|
|
|
|
COPY requirements.txt . |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY . . |
|
|
|
|
|
ENV HF_HOME=/app/.cache |
|
ENV TRANSFORMERS_CACHE=/app/.cache |
|
ENV STREAMLIT_SERVER_PORT=8501 |
|
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 |
|
|
|
EXPOSE 8501 |
|
|
|
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health |
|
|
|
|
|
USER nobody |
|
|
|
CMD ["streamlit", "run", "app.py"] |