Last active
January 2, 2019 16:13
-
-
Save pgilad/0879210a628e2fb686f993d863ec9ad8 to your computer and use it in GitHub Desktop.
Dockerfile to create a zip for AWS Lambda code based on Python 2.7 and Pipenv
This file contains hidden or 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
FROM amazonlinux:latest | |
RUN yum -y update && yum install -y gcc python-devel zip which | |
RUN curl https://bootstrap.pypa.io/get-pip.py | python - | |
RUN pip install pipenv | |
ENV LANG en_US.UTF-8 | |
ENV LC_ALL en_US.UTF-8 | |
ENV SOURCE_DIR lambdas | |
WORKDIR /app | |
COPY Pipfile* ./ | |
RUN pipenv lock -r | sed 's/-e //g' | pip install --upgrade -r /dev/stdin --target . | |
COPY $SOURCE_DIR ./ | |
RUN find . -type f -iname '*.pyc' -delete && rm Pipfile* | |
RUN zip -r /tmp/code_amzn_linux.zip . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment