Model/etl/hubspot/scripts/scraper/handler/Dockerfile
2026-06-17 11:53:33 +00:00

35 lines
No EOL
1.1 KiB
Docker

# 3.11: domain/modelling/measure_type.py (pulled in transitively via
# backend.app.db.models -> infrastructure.postgres.modelling -> domain) uses
# enum.StrEnum, which only exists in Python 3.11+.
FROM public.ecr.aws/lambda/python:3.11
# Set working directory (Lambda task root)
WORKDIR /var/task
# -----------------------------
# Copy requirements FIRST (for Docker layer caching)
# -----------------------------
COPY etl/hubspot/scripts/scraper/handler/requirements.txt .
# Install dependencies into Lambda runtime
RUN pip install --no-cache-dir -r requirements.txt
# Copy necessary files for database and utility imports
COPY backend/ backend/
COPY utils/ utils/
COPY datatypes/ datatypes/
# main -> backend.app.db.models.{epc_property,recommendations} ->
# infrastructure.postgres.{epc_property_table,modelling} -> domain.modelling.
# Without these the lambda fails at init with "No module named 'infrastructure'".
COPY infrastructure/ infrastructure/
COPY domain/ domain/
COPY etl/hubspot etl/hubspot
# Copy the handler
COPY etl/hubspot/scripts/scraper/main.py .
# -----------------------------
# Lambda handler
# -----------------------------
CMD ["main.handler"]