File size: 637 Bytes
44b91cb
 
 
 
 
 
 
 
 
635dc92
44b91cb
 
7a8b830
 
 
 
001dfd0
7a8b830
44b91cb
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use a lightweight Python base image
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /app

# Copy all files from the current directory to the container
COPY . .

# Install Python dependencies, including PyTorch
RUN pip install --no-cache-dir -r requirements.txt

# Create a writable cache directory for Hugging Face models
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache

# Set an environment variable for the cache directory
ENV HF_HOME=/app/.cache

# Expose the port your app will run on
EXPOSE 7860

# Run the FastAPI app with Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]