diff --git a/.gitignore b/.gitignore index 72364f9..1690a0c 100644 --- a/.gitignore +++ b/.gitignore @@ -87,3 +87,4 @@ ENV/ # Rope project settings .ropeproject +*.swp diff --git a/Dockerfile b/Dockerfile index 1d7b9ca..21d0d96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,7 @@ -FROM node:8.1.0 +FROM python:2.7.13 -ENV SERVERLESS_VERSION 1.18.0 - -RUN npm install serverless@${SERVERLESS_VERSION} -g - -RUN apt-get update -RUN apt-get install -y \ - build-essential \ - curl \ - python-dev +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - +RUN apt-get install -y nodejs RUN mkdir /root/.aws @@ -22,6 +15,11 @@ RUN pip install \ pytest-watch \ boto3 +ARG SERVERLESS_VERSION +RUN npm install -g \ + serverless@${SERVERLESS_VERSION} \ + yarn + RUN echo "alias ll='ls -alFh --color=auto'" >> /root/.bashrc RUN echo "alias l='ls -alFh --color=auto'" >> /root/.bashrc diff --git a/Dockerfile-python3 b/Dockerfile-python3 new file mode 100644 index 0000000..a894cc3 --- /dev/null +++ b/Dockerfile-python3 @@ -0,0 +1,27 @@ +FROM python:3.6.2 + +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - +RUN apt-get install -y nodejs + +RUN mkdir /root/.aws + +RUN curl -s https://bootstrap.pypa.io/get-pip.py | python +RUN pip install \ + awscli \ + pep8 \ + pytest \ + pytest-cov \ + pytest-mock \ + pytest-watch \ + boto3 + +ARG SERVERLESS_VERSION +RUN npm install -g \ + serverless@${SERVERLESS_VERSION} \ + yarn + +RUN echo "alias ll='ls -alFh --color=auto'" >> /root/.bashrc +RUN echo "alias l='ls -alFh --color=auto'" >> /root/.bashrc + +RUN mkdir /code +WORKDIR /code diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e0b6ab3 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +NAME = verypossible/serverless +VERSION = 1.19.0 + +.PHONY: all py2 py3 shell + + +all : py2 py3 + +py2 : + docker build \ + -t $(NAME):$(VERSION) \ + --build-arg SERVERLESS_VERSION=$(VERSION) \ + . + +py3 : + docker build \ + -t $(NAME)-python3:$(VERSION) \ + -f Dockerfile-python3 \ + --build-arg SERVERLESS_VERSION=$(VERSION) \ + . + +shell : + docker run --rm -it $(NAME):$(VERSION) bash