From a03970d85bca58a1d73951855012f0a239690666 Mon Sep 17 00:00:00 2001 From: Thomas Schaffter Date: Thu, 5 Dec 2024 01:47:46 +0000 Subject: [PATCH] complete Dockerfile --- apps/sandbox/lambda-python/Dockerfile | 12 +++++++++++- .../__init__.py | 0 .../{hello_world => sandbox_lambda_python}/app.py | 0 3 files changed, 11 insertions(+), 1 deletion(-) rename apps/sandbox/lambda-python/{hello_world => sandbox_lambda_python}/__init__.py (100%) rename apps/sandbox/lambda-python/{hello_world => sandbox_lambda_python}/app.py (100%) diff --git a/apps/sandbox/lambda-python/Dockerfile b/apps/sandbox/lambda-python/Dockerfile index c34df21937..0badbfcd81 100644 --- a/apps/sandbox/lambda-python/Dockerfile +++ b/apps/sandbox/lambda-python/Dockerfile @@ -1,6 +1,16 @@ +FROM python:3.13.0-slim-bullseye AS builder + +# Install the same version of Poetry as inside the dev container +RUN pip install --no-cache-dir poetry==1.8.3 + +WORKDIR /app +COPY pyproject.toml poetry.lock ./ +RUN poetry export --without-hashes --format=requirements.txt > requirements.txt + FROM public.ecr.aws/lambda/python:3.13 -COPY hello_world/app.py requirements.txt ${LAMBDA_TASK_ROOT}/ +COPY --from=builder /app/requirements.txt ${LAMBDA_TASK_ROOT}/ +COPY sandbox_lambda_python/app.py ${LAMBDA_TASK_ROOT}/ RUN python3.13 -m pip install --no-cache-dir -r requirements.txt -t . diff --git a/apps/sandbox/lambda-python/hello_world/__init__.py b/apps/sandbox/lambda-python/sandbox_lambda_python/__init__.py similarity index 100% rename from apps/sandbox/lambda-python/hello_world/__init__.py rename to apps/sandbox/lambda-python/sandbox_lambda_python/__init__.py diff --git a/apps/sandbox/lambda-python/hello_world/app.py b/apps/sandbox/lambda-python/sandbox_lambda_python/app.py similarity index 100% rename from apps/sandbox/lambda-python/hello_world/app.py rename to apps/sandbox/lambda-python/sandbox_lambda_python/app.py