Skip to content

Commit 0b102f3

Browse files
committed
fix aws dockerfile
1 parent 6baf52c commit 0b102f3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

deployment/aws/lambda/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ FROM --platform=linux/amd64 public.ecr.aws/lambda/python:${PYTHON_VERSION}
44

55
WORKDIR /tmp
66

7-
RUN pip install pip -U
8-
RUN pip install "titiler.application==0.18.6" "mangum>=0.10.0" -t /asset --no-binary pydantic
7+
# Install system dependencies to compile (numexpr)
8+
RUN yum install -y gcc-c++
9+
10+
RUN python -m pip install pip -U
11+
RUN python -m pip install "titiler.application==0.18.6" "mangum>=0.10.0" -t /asset --no-binary pydantic
912

1013
# Reduce package size and remove useless files
1114
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;
@@ -14,6 +17,9 @@ RUN cd /asset && find . -type f -a -name '*.py' -print0 | xargs -0 rm -f
1417
RUN find /asset -type d -a -name 'tests' -print0 | xargs -0 rm -rf
1518
RUN rm -rdf /asset/numpy/doc/ /asset/boto3* /asset/botocore* /asset/bin /asset/geos_license /asset/Misc
1619

20+
# Remove system dependencies
21+
RUN yum remove -y gcc-c++
22+
1723
COPY lambda/handler.py /asset/handler.py
1824

1925
CMD ["echo", "hello world"]

0 commit comments

Comments
 (0)