|
|
|
FROM python:3.9-slim |
|
|
|
|
|
ENV HF_HOME="/app/cache" |
|
ENV TRANSFORMERS_CACHE="/app/cache" |
|
|
|
|
|
RUN mkdir -p /app/cache && chmod -R 777 /app/cache |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY requirements.txt /app/ |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY . /app |
|
|
|
|
|
RUN chmod -R 777 /app |
|
|
|
|
|
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/clip-ViT-B-32-multilingual-v1')" && chmod -R 777 /app/cache |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|