Dockerfile36 lines · 832 chars # Base image with Python 3.12
FROM python:3.12.13-bookworm
# Environment settings
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Working directory
WORKDIR /app
# System dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip
RUN python -m pip install --no-cache-dir --upgrade pip
# Install Python dependencies
COPY requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the project
COPY . .
# Expose ports for API and optional Streamlit demo
EXPOSE 8998
EXPOSE 8501
# Default command: start the FastAPI server exposed via uvicorn
CMD ["uvicorn", "scripts.serve_openai_api:app", "--host", "0.0.0.0", "--port", "8998"]