Skip to content

Commit

Permalink
Fix documentation example for python_awslambda targets (pantsbuild#…
Browse files Browse the repository at this point in the history
…18302)

- To run execute the handler it has to be in the LAMBDA_TASK_ROOT
directory
- The leading / in CMD leads to an import error.
  • Loading branch information
cponfick authored Feb 21, 2023
1 parent 43b5d3c commit 90b673c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docs/markdown/Python/python-integrations/awslambda-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,10 @@ For example:
```dockerfile project/Dockerfile
FROM public.ecr.aws/lambda/python:3.8

WORKDIR /build
RUN yum install unzip -y
COPY project/lambda.zip /build
RUN unzip /build/lambda.zip -d /app
WORKDIR /app
CMD ["/app/lambdex_handler.handler"]
COPY project/lambda.zip .
RUN unzip lambda.zip -d "${LAMBDA_TASK_ROOT}"
CMD ["lambdex_handler.handler"]
```
```python project/BUILD
python_sources()
Expand Down

0 comments on commit 90b673c

Please sign in to comment.