File size: 618 Bytes
c2235b0 f4d994b 06c918a afd0d29 c2235b0 06c918a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Use a stable Python runtime as a parent image
FROM python:3.9-buster
# Set the working directory in the container
WORKDIR /app
# Set an environment variable to tell Hugging Face where to cache models
ENV HF_HOME /app/cache
# NEW: Create the cache directory and make it writable by any user
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
# Copy and install the Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code into the container
COPY . .
# The command to run your app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |