Skip to content

Commit

Permalink
Use sys path append
Browse files Browse the repository at this point in the history
  • Loading branch information
abarciauskas-bgse committed Nov 6, 2023
1 parent e200df9 commit 8185b09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion infrastructure/aws/lambda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN rm -rdf /asset/numpy/doc/ /asset/bin /asset/geos_license /asset/Misc
RUN rm -rdf /asset/boto3*
RUN rm -rdf /asset/botocore*
RUN mkdir -p /mnt/efs/libraries
RUN mv /asset/numpy /mnt/efs/libraries/
RUN mv /asset/numpy* /mnt/efs/libraries/
ENV PYTHONPATH="${PYTHONPATH}:/mnt/efs/libraries"

COPY infrastructure/aws/lambda/handler.py /asset/handler.py
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/aws/lambda/handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""AWS Lambda handler."""

import logging
import sys

from mangum import Mangum

Expand All @@ -9,4 +10,5 @@
logging.getLogger("mangum.lifespan").setLevel(logging.ERROR)
logging.getLogger("mangum.http").setLevel(logging.ERROR)

sys.path.append("/mnt/efs/libraries")
handler = Mangum(app, lifespan="off")

0 comments on commit 8185b09

Please sign in to comment.