File size: 895 Bytes
745881b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use a slim and modern Python base image
FROM python:3.11-slim

# Set the working directory inside the container
WORKDIR /app

# Copy the requirements file first to leverage Docker's layer caching
COPY requirements.txt .

# Install dependencies, including build tools for uvloop, then clean up
# --no-cache-dir reduces image size
RUN apt-get update && apt-get install -y build-essential && \
    pip install --no-cache-dir -r requirements.txt && \
    apt-get purge -y --auto-remove build-essential && \
    rm -rf /var/lib/apt/lists/*

# Copy the rest of the application code
COPY phoenix_fury_api.py .

# Expose the port the API will run on
EXPOSE 8000

# Set the command to run the application using uvicorn
# Using --workers 1 because we are managing parallelism with multiprocessing in Python
CMD ["uvicorn", "phoenix_fury_api:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]