Spaces:
Sleeping
Sleeping
File size: 613 Bytes
af16851 a0d7418 af16851 a0d7418 1829e21 a0d7418 af16851 9b582ec 3575d41 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
FROM python:3.10.12
# Set the working directory in the container
WORKDIR /app
# Set the environment variable for the Hugging Face cache
ENV TRANSFORMERS_CACHE=/app/.cache
# Copy the current directory contents into the container at /app
COPY . /app
# Install the Python dependencies from requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Create the cache directory with appropriate permissions
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
# Start the FastAPI app on port 7860, the default port expected by Spaces
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|