Skip to content

Instantly share code, notes, and snippets.

@anna-geller
Created June 27, 2021 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anna-geller/55befee758098bb2be6df4ce39569d30 to your computer and use it in GitHub Desktop.
Save anna-geller/55befee758098bb2be6df4ce39569d30 to your computer and use it in GitHub Desktop.
# set a base image that includes Lambda Runtime API:
# Source: https://hub.docker.com/r/amazon/aws-lambda-python
FROM amazon/aws-lambda-python:3.8
# optional: ensure that pip is up to date
RUN /var/lang/bin/python3.8 -m pip install --upgrade pip
# first we COPY only requirements.txt to ensure that later builds
# with changes to your src code will be faster due to caching of this layer
COPY requirements.txt .
RUN pip install -r requirements.txt
# copy all your custom modules and files from the src directory
COPY src/ .
# specify Lambda handler that will be invoked on container start
CMD [ "lambda.handler"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment