mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
35 lines
No EOL
1.3 KiB
Docker
35 lines
No EOL
1.3 KiB
Docker
# jammy (Ubuntu 22.04) ships Python 3.10, which lacks enum.StrEnum — used by
|
|
# domain/modelling/measure_type.py, pulled in transitively via the copied
|
|
# domain/ package. noble (Ubuntu 24.04) ships Python 3.12.
|
|
FROM mcr.microsoft.com/playwright/python:v1.58.0-noble
|
|
|
|
# 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 backend/ecmk_fetcher/handler/requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY utils/ utils/
|
|
COPY backend/ backend/
|
|
COPY datatypes/ datatypes/
|
|
# handler -> ecmk_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/
|
|
|
|
# Local lambda entrypoint
|
|
# ENTRYPOINT ["/usr/local/bin/aws-lambda-rie", "python", "-m", "awslambdaric"]
|
|
|
|
#AWS lambda entrypoint
|
|
ENTRYPOINT ["python", "-m", "awslambdaric"]
|
|
|
|
# -----------------------------
|
|
# Lambda handler
|
|
# -----------------------------
|
|
CMD ["backend.ecmk_fetcher.handler.handler.handler"] |