File size: 527 Bytes
d15a2f0
 
9cdc952
d15a2f0
1dd8583
d15a2f0
 
1dd8583
 
 
d15a2f0
 
 
1dd8583
d15a2f0
6ee032f
1dd8583
d15a2f0
1dd8583
 
d15a2f0
105a66a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Use official Python base image
FROM python:3.11-slim

# Set the working directory
WORKDIR /app

# Copy all files to the container
COPY . /app


# Set HF_HOME to use an accessible cache directory
ENV HF_HOME=/app/.cache
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache

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

# Expose port (Hugging Face uses port 7860 by default)
EXPOSE 7860

# Run the FastAPI server using uvicorn
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]