Skip to content

Instantly share code, notes, and snippets.

@mvoitko
Created July 20, 2019 11:29
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 mvoitko/0f3d15ebac05fbafa9c356291d7fb2d4 to your computer and use it in GitHub Desktop.
Save mvoitko/0f3d15ebac05fbafa9c356291d7fb2d4 to your computer and use it in GitHub Desktop.
Lambda Base image
ARG PYTHON_VERSION
FROM lambci/lambda:build-python$PYTHON_VERSION
RUN pip install -U pip
RUN pip install poetry==1.0.0a2
COPY bin/entrypoint /bin
ENV AWS_REGION="eu-west-1"
ENV AWS_DEFAULT_REGION="eu-west-1"
ENV PATH="/root/.poetry/bin:${PATH}"
ENTRYPOINT /bin/entrypoint $0 $@
#!/bin/bash
source $HOME/.poetry/env
poetry config settings.virtualenvs.create false
poetry install $POETRY_NO_DEV
rm -rf ./vendor
# Remove some log strings from poetry output
poetry run pip freeze | grep -v "-e /var/task" | grep -v "Editable install" | grep -v "Skipping virtualenv creation" > requirements.txt
pip install -r requirements.txt -t ./vendor --extra-index-url http://{custom_repo_server_host}/pypi/packages --trusted-host {custom_repo_server_host}
if [ -z "$AWS_PROFILE" ]; then
unset AWS_PROFILE
fi
$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment