File size: 804 Bytes
b29ef91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 official Python lightweight image
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install git (required to install packages from github if needed)
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

# Copy requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install git+https://github.com/amazon-science/chronos-forecasting.git

# Copy the rest of the application
COPY . .

# Expose the port Uvicorn will run on (Hugging Face Spaces defaults to 7860, Render also uses PORT)
EXPOSE 7860

# Command to run the application
# We use the $PORT environment variable which Hugging Face sets to 7860, or default to 7860
CMD ["sh", "-c", "uvicorn api:app --host 0.0.0.0 --port ${PORT:-7860}"]