Created
July 20, 2019 11:29
-
-
Save mvoitko/0f3d15ebac05fbafa9c356291d7fb2d4 to your computer and use it in GitHub Desktop.
Lambda Base image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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