File size: 802 Bytes
6c5a97c
 
 
 
 
 
28ab8e9
 
 
 
 
 
6c5a97c
28ab8e9
 
6c5a97c
 
28ab8e9
6c5a97c
 
28ab8e9
6c5a97c
 
28ab8e9
6c5a97c
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
# Start with an official Python base image.
FROM python:3.11-slim

# Set the working directory inside the container.
WORKDIR /app

# Create a directory for the model cache and set permissions
RUN mkdir -p /app/model_cache && chmod 777 /app/model_cache

# CRITICAL FIX: Set the Hugging Face cache directory to our writable folder
ENV HF_HOME /app/model_cache
ENV SENTENCE_TRANSFORMERS_HOME /app/model_cache

# Copy the requirements file and install dependencies.
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of your application code.
COPY . .

# Expose the port the application will run on.
EXPOSE 7860

# The command to run your application.
CMD ["gunicorn", "-w", "1", "--preload", "-k", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:7860", "main:app"]