FROM amazon/aws-lambda-python:3.12

RUN dnf -y update
RUN dnf -y install gcc

RUN rm -rf /etc/dnf/vars/releasever
RUN dnf --refresh update -y --releasever=latest

COPY requirements.txt ./ 
COPY requirements-dev.txt ./
RUN pip install --upgrade pip setuptools && \
    pip install -r requirements.txt && \
    pip install -r requirements-dev.txt
RUN pip install -q -i https://pypi.theorchard.io/pypi/ qa-testing-utils

COPY config.py app.py lint-and-test.sh docker-compose.yaml .flake8 ./
COPY schedule_auto_add/ ./schedule_auto_add
COPY tests/ ./tests

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