| |
| FROM python:3.9-slim |
|
|
| |
| ENV PYTHONDONTWRITEBYTECODE 1 |
| ENV PYTHONUNBUFFERED 1 |
|
|
| |
| RUN mkdir -p /cache/huggingface && chmod -R 777 /cache |
| ENV TRANSFORMERS_CACHE=/cache/huggingface |
|
|
| |
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| cmake \ |
| libprotobuf-dev \ |
| protobuf-compiler \ |
| libsentencepiece-dev \ |
| libsentencepiece0 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt /app/ |
|
|
| |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY app.py /app/ |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|