| # ---------- Dockerfile ---------- | |
| FROM python:3.11-slim | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 | |
| WORKDIR /app | |
| # copy code và requirements | |
| COPY requirements.txt /app/ | |
| COPY main.py /app/ | |
| # cài thư viện từ requirements | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| EXPOSE 7860 | |
| # chạy server | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |
| # ---------- end ---------- |