File size: 839 Bytes
6de69e5
9ff5556
 
6de69e5
 
9ff5556
6de69e5
 
 
9ff5556
6de69e5
 
9ff5556
6de69e5
 
 
 
 
 
 
 
 
 
 
 
 
9ff5556
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
# 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", "app:app", "--host", "0.0.0.0", "--port", "7860"]