ARG BASE_IMAGE=amazon/aws-lambda-python:3.11
FROM ${BASE_IMAGE}

ARG version
LABEL Version=$version
ENV build_version=$version

COPY requirements.txt ./

RUN echo "assumeyes=1" >> /etc/yum.conf
RUN yum update && yum install -y gcc make

RUN pip install --upgrade pip && \
    pip install setuptools wheel && \
    pip install -r requirements.txt

COPY src/ ./
COPY config.py ./
COPY --from=common . ./common/
COPY constants/ ./constants/

EXPOSE 8080

CMD [ "index.handler" ]
