Spaces:
Sleeping
Sleeping
File size: 635 Bytes
56f1942 81dbfc5 56f1942 81dbfc5 56f1942 25bab19 |
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.12-slim
# Install system dependencies
RUN apt-get update && apt-get install -y git
# Set environment variable to avoid permission issues
ENV TRANSFORMERS_CACHE=/code/.cache
# Set working directory
WORKDIR /code
# Copy requirements
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the app
COPY . .
# Create cache directory and give full permissions (just in case)
RUN mkdir -p /code/.cache && chmod -R 777 /code/.cache
# Expose port 7860
EXPOSE 7860
# Run the FastAPI app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|