Skip to content

AWS Lambda - Container #166

Answered by koxudaxi
stephenbawks asked this question in Q&A
Discussion options

You must be logged in to vote

@stephenbawks
Did you create __init__.py in the app directory?

- /poetry.lock
   pyproject.toml
   Dockerfile
   app/__init__.py
       main.py

And, I fixed your Dockerfile.

# Define function directory
FROM public.ecr.aws/lambda/python:3.8

RUN pip install poetry

COPY ./app /var/task/app

COPY ./poetry.lock  ./pyproject.toml ./
RUN poetry config virtualenvs.create false && poetry install --no-dev

CMD [ "app.main.handler" ]

You should think about how to use poetry. this example may not best practice on poetry.
Thank you.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jordaneremieff
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #165 on March 12, 2021 12:45.