diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..78a06d0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:8.10-alpine + +ARG AWS_CLI_VERSION=1.16.86 + +RUN apk --update add python py-pip bash make imagemagick && \ + pip --no-cache-dir install awscli==$AWS_CLI_VERSION diff --git a/README.md b/README.md index dd66f24..dc45a13 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ put on AWS S3 bucket, this package will resize/reduce it and put to S3. ## Requirements - Node.js ( AWS Lambda supports versions of **6.10** and **8.10** ) +- **OR** Docker ## Preparation @@ -141,6 +142,19 @@ npm run test-config ## Installation +### Docker + +To avoid installation you may run all the commands from a docker container that has all dependencies installed. + +The following command will build the docker image from the Dockerfile and tag it with `aws-lambda-image:latest` +```bash +docker build -t aws-lambda-image:latest . +``` +The following command will run the docker image in a container called lambda-img and also mounts your user home to the containers ~/ so that you may reuse the aws credentials on your host in ~/.aws +```bash +docker run -v ~/:/root --name lambda-img -it aws-lambda-image:latest bash +``` + ### Setup To use the automated deployment scripts you will need to have