File size: 484 Bytes
e389ca1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use Python 3.9
FROM python:3.9

# Set working directory
WORKDIR /app

# Copy requirements and install them
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the server code
COPY server.py .

# Create a cache directory for the model (fixes permission errors)
RUN mkdir -p /app/cache
ENV HF_HOME=/app/cache
RUN chmod -R 777 /app/cache

# Expose the port Hugging Face uses
EXPOSE 7860

# Run the server
CMD ["python", "server.py"]