FROM mcr.microsoft.com/playwright/python:v1.58.0-jammy # Install AWS Lambda RIE ADD https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie /usr/local/bin/aws-lambda-rie RUN chmod +x /usr/local/bin/aws-lambda-rie # Set working directory (Lambda task root) WORKDIR /var/task COPY utils/ utils/ COPY backend/ backend/ COPY datatypes/ datatypes/ # handler -> pashub_service -> documents_parser.parser -> datatypes.epc.domain.mapper # -> domain.sap10_calculator, and -> db_writer -> epc_property model # -> infrastructure.postgres. Without these the lambda fails at init with # "No module named 'domain'" / "'infrastructure'". COPY domain/ domain/ COPY infrastructure/ infrastructure/ COPY backend/pashub_fetcher/handler/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Local lambda entrypoint # ENTRYPOINT ["/usr/local/bin/aws-lambda-rie", "python", "-m", "awslambdaric"] #AWS lambda entrypoint ENTRYPOINT ["python", "-m", "awslambdaric"] # ----------------------------- # Lambda handler # ----------------------------- CMD ["backend.pashub_fetcher.handler.handler.handler"]