-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize Dockerfile and app.py for Lambda function setup
- Loading branch information
Your Name
committed
May 2, 2025
1 parent
48ad606
commit 263003e
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| FROM public.ecr.aws/lambda/python:3.11 | ||
|
|
||
| # Copy requirements first to leverage Docker cache | ||
| COPY requirements.txt /tmp/ | ||
| RUN pip install --no-cache-dir -r /tmp/requirements.txt -t ${LAMBDA_TASK_ROOT} | ||
|
|
||
| # Copy the template_automation package | ||
| COPY template_automation/ ${LAMBDA_TASK_ROOT}/template_automation/ | ||
|
|
||
| # Copy the root app.py file (this is essential for AWS Lambda to find the handler) | ||
| COPY app.py ${LAMBDA_TASK_ROOT}/ | ||
|
|
||
| # Ensure the Lambda handler is correctly set | ||
| CMD [ "app.lambda_handler" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| """ | ||
| Lambda function entrypoint that imports the handler from the template_automation package. | ||
| This file resolves the 'attempted relative import with no known parent package' | ||
| error by placing an entrypoint at the root level of the Lambda package. | ||
| """ | ||
|
|
||
| from template_automation.app import lambda_handler | ||
|
|
||
| # Re-export the lambda_handler function for Lambda runtime to find it | ||
| __all__ = ['lambda_handler'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters