Skip to content

Commit 6c9f37f

Browse files
committed
update docker for raster lambda
1 parent 64666c0 commit 6c9f37f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

infrastructure/dockerfiles/Dockerfile.raster

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG PYTHON_VERSION=3.12
33
FROM public.ecr.aws/lambda/python:${PYTHON_VERSION}
44

55
# Install system dependencies to compile (numexpr)
6-
RUN yum install -y gcc-c++
6+
RUN dnf install -y gcc-c++ && dnf clean all
77

88
WORKDIR /tmp
99
RUN python -m pip install pip -U
@@ -12,8 +12,6 @@ COPY runtimes/eoapi/raster /tmp/raster
1212
RUN python -m pip install "mangum>=0.14,<0.15" /tmp/raster["psycopg-binary"] -t /asset --no-binary pydantic
1313
RUN rm -rf /tmp/raster
1414

15-
# Remove system dependencies
16-
RUN yum remove -y gcc-c++
1715

1816
# Reduce package size and remove useless files
1917
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;
@@ -22,6 +20,11 @@ RUN cd /asset && find . -type f -a -name '*.py' -print0 | xargs -0 rm -f
2220
RUN find /asset -type d -a -name 'tests' -print0 | xargs -0 rm -rf
2321
RUN rm -rdf /asset/numpy/doc/ /asset/boto3* /asset/botocore* /asset/bin /asset/geos_license /asset/Misc
2422

23+
# Ref: https://github.com/developmentseed/titiler/discussions/1108#discussioncomment-13045681
24+
RUN cp /usr/lib64/libexpat.so.1 /asset/
25+
2526
COPY infrastructure/handlers/raster_handler.py /asset/handler.py
2627

28+
WORKDIR /asset
29+
2730
CMD ["echo", "hello world"]

0 commit comments

Comments
 (0)