diff --git a/deployment/lambda/lambda_example/docker/Dockerfile b/deployment/lambda/lambda_example/docker/Dockerfile index 3aa661b..fef6e87 100644 --- a/deployment/lambda/lambda_example/docker/Dockerfile +++ b/deployment/lambda/lambda_example/docker/Dockerfile @@ -1,7 +1,25 @@ # AWS Lambda python pacakge FROM public.ecr.aws/lambda/python:3.11 -# Copy function code +# Install Poetry (you could pin a version if you like) +RUN curl -sSL https://install.python-poetry.org | python3 - + +# Add Poetry to PATH +ENV PATH="/root/.local/bin:$PATH" + +# Set working directory +WORKDIR /var/task + +# Copy Poetry files first to leverage Docker layer caching +COPY pyproject.toml poetry.lock README.md ./ +COPY etl/ etl/ + + +# Install dependencies into /var/task +RUN poetry config virtualenvs.create false \ + && poetry install --only main --no-interaction --no-ansi + +# Copy app code COPY deployment/lambda/lambda_example/docker/app.py ./ # Set the CMD to your handler