Spaces:
Runtime error
Runtime error
File size: 710 Bytes
57264e7 95d0556 57264e7 95d0556 57264e7 b438270 57264e7 95d0556 9efbefb 57264e7 95d0556 f049b64 11406d1 57264e7 95d0556 57264e7 95d0556 11406d1 95d0556 7f707e5 |
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 30 31 |
FROM python:3.9-slim
WORKDIR /app
# Install required system packages
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY main.py .
# Create writable cache directory for Hugging Face
RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
ENV HF_HOME=/app/hf_cache
# Optional: Pass your Hugging Face token
ENV HF_TOKEN=$HF_TOKEN
# Expose port for Uvicorn
EXPOSE 8000
# Run the FastAPI app (from main.py)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|