phobert-tox-api / Dockerfile
DungSon's picture
Update Dockerfile
e30d16b verified
raw
history blame contribute delete
704 Bytes
FROM python:3.11-slim
ENV HF_HOME=/tmp/hf
ENV HF_HUB_CACHE=/tmp/hf/hub
ENV TRANSFORMERS_CACHE=/tmp/hf/transformers
ENV TOKENIZERS_PARALLELISM=false
# Cài system deps tối thiểu
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 1) Cài dependencies từ requirements.txt ở THƯ MỤC GỐC
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 2) Copy toàn bộ mã nguồn (app.py, modeling_phobert_attn.py, v.v…)
COPY . /app
ENV TOKENIZERS_PARALLELISM=false
# Spaces sẽ route cổng này
EXPOSE 7860
# app.py ở gốc repo → module path là "app:app"
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]