Spaces:
Runtime error
Runtime error
File size: 700 Bytes
3d586a3 87388da 3d586a3 5f5218b 7ca4286 5f5218b 7ca4286 c1faedb 3d586a3 5f5218b 3d586a3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | FROM python:3.10-slim
RUN apt-get update && apt-get install -y libgomp1 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Set writable paths for caches
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV HF_HOME=/tmp/hf_cache
ENV TRANSFORMERS_CACHE=/tmp/hf_cache
ENV XDG_CACHE_HOME=/tmp/cache
# Create cache directories and give full permissions
RUN mkdir -p /tmp/hf_cache /tmp/cache /tmp/matplotlib \
&& chmod -R 777 /tmp/hf_cache /tmp/cache /tmp/matplotlib
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
COPY main.py .
COPY frontend ./frontend
EXPOSE 8000
ENV PYTHONUNBUFFERED=1
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|