-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from cormorack/update-aws-lambda
Update AWS lambda deployment from using cdk v1 to v2
- Loading branch information
Showing
8 changed files
with
688 additions
and
184 deletions.
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
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
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
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
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 |
---|---|---|
@@ -1,16 +1,19 @@ | ||
ARG PYTHON_VERSION=3.11 | ||
|
||
FROM amazon/aws-lambda-python:3.8 | ||
|
||
LABEL maintainer="Landung Setiawan" | ||
RUN yum update -y && \ | ||
yum install -y python3 python3-dev python3-pip gcc libcurl-devel libssh2-devel nss-devel which git && \ | ||
rm -Rf /var/cache/yum | ||
RUN which curl-config | ||
ENV LD_LIBRARY_PATH=/usr/lib | ||
ENV PYCURL_CURL_CONFIG=/usr/bin/curl-config | ||
ENV PYCURL_SSL_LIBRARY=nss | ||
COPY ./ /tmp/app | ||
RUN pip install /tmp/app | ||
RUN pip install mangum>=0.10.0 | ||
RUN rm -rf /tmp/app | ||
COPY resources/aws/lambda/handler.py ./ | ||
CMD ["handler.handler"] | ||
WORKDIR /tmp | ||
|
||
RUN pip install pip -U | ||
RUN pip install "titiler.application==0.17.0" "mangum>=0.10.0" -t /asset --no-binary pydantic | ||
|
||
# Reduce package size and remove useless files | ||
RUN cd /asset && find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[0-9]*//'); cp $f $n; done; | ||
RUN cd /asset && find . -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf | ||
RUN cd /asset && find . -type f -a -name '*.py' -print0 | xargs -0 rm -f | ||
RUN find /asset -type d -a -name 'tests' -print0 | xargs -0 rm -rf | ||
RUN rm -rdf /asset/numpy/doc/ /asset/boto3* /asset/botocore* /asset/bin /asset/geos_license /asset/Misc | ||
|
||
COPY lambda/handler.py /asset/handler.py | ||
|
||
CMD ["echo", "hello world"] |
Oops, something went wrong.