Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Commit 255b1aa

Browse files
committed
fix: additional fix
1 parent 38715be commit 255b1aa

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

infrastructure/aws/lambda/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ WORKDIR /asset
2525
RUN python -c "from rustac import DuckdbClient; client = DuckdbClient(install_extensions=True, extension_directory='/asset/duckdb-extensions'); client.execute('CREATE SECRET (TYPE S3, PROVIDER CREDENTIAL_CHAIN)')"
2626
RUN find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[0-9]*//'); cp $f $n; done;
2727
RUN find . -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
28-
RUN find . -type f -a -name '*.py' -print0 | xargs -0 rm -f
2928
RUN find . -type d -a -name 'tests' -print0 | xargs -0 rm -rf
3029
RUN find . -type f -name '*.so*' -exec strip --strip-unneeded {} \;
3130

3231
FROM --platform=${BUILDPLATFORM} public.ecr.aws/lambda/python:${PYTHON_VERSION}
33-
WORKDIR /asset
34-
COPY --from=builder /asset /asset
35-
COPY infrastructure/aws/lambda/handler.py /asset/handler.py
36-
37-
ENTRYPOINT [ "python", "handler.py" ]
32+
WORKDIR ${LAMBDA_TASK_ROOT}
33+
COPY --from=builder /asset ${LAMBDA_TASK_ROOT}
34+
COPY infrastructure/aws/lambda/handler.py ${LAMBDA_TASK_ROOT}
35+
CMD [ "handler.handler" ]

infrastructure/aws/lambda/handler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""AWS Lambda handler."""
22

33
import logging
4+
import os
45
from pathlib import Path
56

67
import stac_fastapi.geoparquet.api
@@ -10,7 +11,7 @@
1011
logging.getLogger("mangum.lifespan").setLevel(logging.ERROR)
1112
logging.getLogger("mangum.http").setLevel(logging.ERROR)
1213

13-
extension_directory = Path("/asset/duckdb-extensions")
14+
extension_directory = Path(os.environ["LAMBDA_TASK_ROOT"]) / "duckdb-extensions"
1415

1516
duckdb_client = DuckdbClient(
1617
install_extensions=False,

0 commit comments

Comments
 (0)