File size: 687 Bytes
abafda1
eb66dcb
 
abafda1
eb66dcb
 
abafda1
eb66dcb
 
abafda1
 
eb66dcb
abafda1
 
eb66dcb
abafda1
 
eb66dcb
abafda1
286227c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Use a slim version of Python 3.10 as the base image
FROM python:3.10-slim

# Set the working directory inside the container
WORKDIR /app

# Copy the contents of the current directory into the container's working directory
COPY ./ /app

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

# Set environment variable for Hugging Face cache (optional but recommended)
ENV TRANSFORMERS_CACHE=/tmp/huggingface_cache

# Expose the port the app will run on (7860 in this case)
EXPOSE 7860

# Command to run the FastAPI app with uvicorn (make sure your app is in main.py)
CMD ["uvicorn", "app:app", "--reload", "--host=0.0.0.0", "--port=7860"]