Last active
December 20, 2019 02:50
-
-
Save umihico/8b1082980f29c9d72c69ff0a937f6ce8 to your computer and use it in GitHub Desktop.
publish python layer in AWS Lambda easily
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
version: '3' | |
services: | |
app: | |
image: lambci/lambda:build-python3.7 | |
volumes: | |
- '.:/var/task' | |
working_dir: /var/task | |
command: bash -c 'mkdir python && pip install -r requirements.txt -t ./python lxml && zip -r layer.zip python && rm -rf python' |
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
wget https://gist.githubusercontent.com/umihico/8b1082980f29c9d72c69ff0a937f6ce8/raw/docker-compose.yml | |
echo $1>requirements.txt | |
docker-compose up | |
aws lambda publish-layer-version --layer-name $1 --zip-file fileb://layer.zip --compatible-runtimes python3.7 | |
rm -rf layer.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment