FROM python:3.10.13-slim

RUN pip --no-cache-dir install -U pip
RUN pip --no-cache-dir install boto3==1.33.9 \
    langchain==0.1.0 \
    langchain-community==0.0.20 \
    opensearch-py==2.2.0 \
    beautifulsoup4==4.12.3

# Include python script for retrieving credentials from AWS SecretsManager and Sagemaker helper classes
ADD credentials.py /code/
ADD sm_helper.py /code/

# Set some environment variables. PYTHONUNBUFFERED keeps Python from buffering our standard
# output stream, which means that logs can be delivered to the user quickly. PYTHONDONTWRITEBYTECODE
# keeps Python from writing the .pyc files which are unnecessary in this case. We also update
# PATH so that the train and serve programs are found when the container is invoked.
ENV PYTHONUNBUFFERED=TRUE
ENV PYTHONDONTWRITEBYTECODE=TRUE
