mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
The lift-and-shift moved the handler to applications/condition/handler.py and split the module across domain/infrastructure/repositories/applications, but the Dockerfile still COPYed backend/condition/ and ran the old CMD path. Update the COPYs to the handler's real import closure (the DDD dirs + the legacy backend Base/db_session/settings bridges) and the CMD to applications/condition/handler. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
53 lines
1.6 KiB
Docker
53 lines
1.6 KiB
Docker
FROM public.ecr.aws/lambda/python:3.11
|
|
# For local running:
|
|
# FROM python:3.11.10-bullseye
|
|
|
|
ARG DEV_DB_HOST
|
|
ARG DEV_DB_PORT
|
|
ARG DEV_DB_NAME
|
|
|
|
|
|
# Set working directory (Lambda task root)
|
|
WORKDIR /var/task
|
|
|
|
# Environment
|
|
ENV DB_HOST=${DEV_DB_HOST}
|
|
ENV DB_PORT=${DEV_DB_PORT}
|
|
ENV DB_NAME=${DEV_DB_NAME}
|
|
|
|
COPY backend/.env.test backend/.env
|
|
|
|
# -----------------------------
|
|
# Copy requirements FIRST (for Docker layer caching)
|
|
# -----------------------------
|
|
COPY applications/condition/requirements.txt .
|
|
|
|
# Install dependencies into Lambda runtime
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# -----------------------------
|
|
# Copy application code (the handler's import closure — DDD layout)
|
|
# -----------------------------
|
|
COPY utils/ utils/
|
|
COPY domain/ domain/
|
|
COPY infrastructure/ infrastructure/
|
|
COPY repositories/ repositories/
|
|
COPY applications/ applications/
|
|
|
|
# Legacy backend bridges still imported by the condition module:
|
|
# ConditionPostgres -> backend.app.db.connection (db_session);
|
|
# condition_tables -> backend.app.db.base (Base); connection -> backend.app.config.
|
|
COPY backend/app/config.py backend/app/config.py
|
|
COPY backend/app/db/base.py backend/app/db/base.py
|
|
COPY backend/app/db/connection.py backend/app/db/connection.py
|
|
COPY backend/__init__.py backend/__init__.py
|
|
COPY backend/app/__init__.py backend/app/__init__.py
|
|
COPY backend/app/db/__init__.py backend/app/db/__init__.py
|
|
|
|
|
|
# -----------------------------
|
|
# Lambda handler
|
|
# -----------------------------
|
|
CMD ["applications/condition/handler.handler"]
|
|
# For local running
|
|
# CMD ["python", "-m", "applications.condition.handler"]
|