File size: 698 Bytes
5f3a5b8
 
 
 
 
 
47fae8e
 
b19aa89
47fae8e
 
5f3a5b8
47fae8e
5f3a5b8
 
 
47fae8e
 
5f3a5b8
47fae8e
 
5f3a5b8
47fae8e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use an official Python base image
FROM python:3.11-slim

# Set the working directory inside the container
WORKDIR /code

# Set environment variable for Hugging Face cache
ENV HF_HOME /code/.cache

# Create the cache directory and make it fully writable.
RUN mkdir -p /code/.cache && chmod -R 777 /code/.cache

# Copy and install requirements
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Copy application code (renamed to main.py to match your file)
COPY ./main.py /code/app.py

# Expose the port Hugging Face Spaces expects
EXPOSE 7860

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