# Dockerfile -- tests

FROM amazon/aws-lambda-python:3.11

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

RUN yum install gcc -y

# Security patch
RUN yum update glib2 -y

COPY --from=public.ecr.aws/datadog/lambda-extension:53 /opt/extensions/ /opt/extensions

ENV POETRY_VIRTUALENVS_IN_PROJECT=0
ENV POETRY_VIRTUALENVS_CREATE=0

COPY config.py ./
COPY pyproject.toml poetry.lock ./
COPY src/ ./src
COPY tests/ ./tests
COPY scripts/ ./scripts


# Install poetry
RUN pip install poetry==1.7.1

RUN poetry install

ENTRYPOINT [ "sh", "-c", "./scripts/unit-lint.sh" ]