FROM python:3.12-slim
WORKDIR /app
RUN apt-get update && apt-get install --no-install-recommends -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
RUN curl --fail --show-error --silent https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem -o /app/rds-global-bundle.pem
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY api.py .
RUN useradd --create-home --uid 10001 app
USER app
EXPOSE 8080
CMD ["opentelemetry-instrument", "uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8080"]
