File size: 703 Bytes
8842208
 
 
 
 
 
cad4da6
 
 
 
 
8842208
 
 
 
 
 
 
 
 
 
 
 
 
 
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 from a standard Python base image
FROM python:3.9

# Set the working directory inside the container
WORKDIR /code

# --- ADD THIS LINE ---
# Set the cache directory to a writable location inside the container
ENV HF_HOME /code/cache
# --------------------

# Copy the requirements file into the container
COPY ./requirements.txt /code/requirements.txt

# Install the Python dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Copy your application code into the container
COPY ./app.py /code/app.py

# Expose the port the app runs on
EXPOSE 8000

# The command to run your FastAPI app using uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]