co-po-api / Dockerfile
MakPr016
Fix cache directory permissions
0450294
raw
history blame contribute delete
412 Bytes
FROM python:3.11-slim
WORKDIR /app
# Set writable cache directory
ENV TRANSFORMERS_CACHE=/tmp/cache
ENV SENTENCE_TRANSFORMERS_HOME=/tmp/cache
ENV HF_HOME=/tmp/cache
# Create cache directory
RUN mkdir -p /tmp/cache && chmod 777 /tmp/cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]