Spaces:
Sleeping
Sleeping
File size: 686 Bytes
d6791c3 5a2ce3f d6791c3 a5400c3 5a2ce3f d6791c3 |
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 |
# Use the official Python image as the base
FROM python:3.9-slim
# Set the working directory inside the container
WORKDIR /app
# Set environment variables for cache
ENV HF_HOME=/tmp/hf_cache
ENV HUGGINGFACE_HUB_CACHE=/tmp/hf_cache
ENV TRANSFORMERS_CACHE=/tmp/hf_cache
# Copy all project files to the container
COPY . /app
# Install the required Python packages
RUN pip install --no-cache-dir -r requirements.txt
# Create the cache directory and set permissions
RUN mkdir -p /tmp/hf_cache && chmod -R 777 /tmp/hf_cache
# Expose the port that FastAPI will run on
EXPOSE 7860
# Command to run the FastAPI application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |