|
|
FROM python:3.9-slim |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
build-essential \ |
|
|
curl \ |
|
|
git \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
ENV TRANSFORMERS_CACHE=/tmp/huggingface_cache |
|
|
ENV HF_HOME=/tmp/huggingface_cache |
|
|
ENV HF_DATASETS_CACHE=/tmp/huggingface_cache |
|
|
ENV HF_METRICS_CACHE=/tmp/huggingface_cache |
|
|
|
|
|
COPY requirements.txt ./ |
|
|
COPY src/ ./src/ |
|
|
COPY best_model/ ./best_model/ |
|
|
|
|
|
RUN pip3 install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
EXPOSE 8501 |
|
|
EXPOSE 8000 |
|
|
|
|
|
|
|
|
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1 |
|
|
|
|
|
|
|
|
CMD uvicorn src.api:app --host 0.0.0.0 --port 8000 & \ |
|
|
streamlit run src/streamlit_app.py --server.port=8501 --server.address=0.0.0.0 |
|
|
|