File size: 803 Bytes
a8e9ef6 631023b a8e9ef6 b89aad2 a8e9ef6 0d34a5d a8e9ef6 51f0272 a8e9ef6 51f0272 a8e9ef6 51f0272 0d34a5d a8e9ef6 51f0272 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
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
# Portları açırıq
EXPOSE 8501
EXPOSE 8000
# Healthcheck yalnız Streamlit üçün
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
# Həm FastAPI, həm də Streamlit başlasın
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
|