File size: 805 Bytes
2462ba9
c2bf4e3
2462ba9
 
1e0b689
5e12619
eaf2cd3
2462ba9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22667b1
2462ba9
 
 
 
 
 
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
27
28
29
# Use an official Python runtime as a parent image
FROM python:3.10

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


# Set the working directory to /app
WORKDIR /app

# Copy the requirements.txt file into the container at /app
COPY requirements.txt .

# Install any needed packages specified in requirements.txt
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code into the container at /app, including the .cache folder
COPY . /app

# Ensure the .cache folder is writable
RUN chmod -R 777 /app/.cache
RUN chmod 777 api_logs.jsonl

# Expose port 7860 for the app
EXPOSE 7860

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