File size: 841 Bytes
bf1805c 7fd5dfa 3d0cab5 bf1805c 3d0cab5 67f004f bb87cb9 67f004f 3d0cab5 bf1805c a7537b0 bf1805c 3d0cab5 751fb6b bf1805c 3d0cab5 bf1805c |
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 |
# Use an official Python runtime as a parent image
FROM python:3.10.9
# Set the working directory in the container to /app
WORKDIR /app
# Create a directory for Hugging Face cache and set broad permissions
RUN mkdir -p /app/hf_cache
RUN chmod -R 777 /app/hf_cache
# Set environment variable for Hugging Face home
ENV HF_HOME=/app/hf_cache
# Copy the requirements file into the container at /app
COPY ./requirements.txt /app/requirements.txt
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
# Copy the rest of the application into the container at /app
COPY . /app
# Make port 7860 available to the world outside this container
EXPOSE 7860
# Define the command to run the app using uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|