FROM public.ecr.aws/lambda/python:3.13

ARG version
LABEL Version=$version
LABEL com.datadoghq.tags.service="onboard-shopify-stores"
LABEL com.datadoghq.tags.version=$version
ENV build_version=$version
ENV DD_SERVICE=onboard-shopify-stores
ENV DD_VERSION=$version

RUN dnf update -y && dnf upgrade -y

COPY --from=public.ecr.aws/datadog/lambda-extension:73 /opt/extensions/ /opt/extensions
COPY --from=ghcr.io/astral-sh/uv:0.11.25 /uv /usr/local/bin/uv

COPY pyproject.toml uv.lock ./
RUN uv export --frozen --no-dev -o /tmp/requirements.txt && \
    pip install --no-cache-dir -r /tmp/requirements.txt

COPY src/ ./src
COPY config.py ./

EXPOSE 8080

ENV DD_LAMBDA_HANDLER=src.app.handler
CMD [ "datadog_lambda.handler.handler" ]
