File size: 712 Bytes
7298db2
 
 
 
 
 
39e8e1c
 
41d96c7
40dc9ea
 
 
7298db2
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use an official Python runtime as a parent image
FROM python:3.10

# Set the working directory in the container
WORKDIR /app

# Set the cache directory for Hugging Face to a writable location
ENV HF_HOME /app/.cache/huggingface

# Create the cache directory and set permissions
RUN mkdir -p /app/.cache && chmod 777 /app/.cache

# Copy the requirements file into the container
COPY requirements.txt .

# Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application code into the container
COPY . .

# Expose the port your FastAPI app will run on
EXPOSE 7860

# Command to run the application using Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]