FROM amazon/aws-lambda-python:3.11-x86_64

# Cached natively if unchanged.
COPY requirements.txt ./requirements.txt
COPY requirements-dev.txt ./requirements-dev.txt

# Requirements will only reinstall if they have changed.
RUN pip install --upgrade pip
RUN pip install setuptools wheel
RUN pip install -r requirements.txt -r requirements-dev.txt

COPY .coveragerc docker-compose.yaml .flake8 lint-and-test.sh ./
COPY tests ./tests

COPY index.py config.py queries.py ./

ENTRYPOINT ["/var/task/lint-and-test.sh"]
