Skip to content

Commit

Permalink
Merge pull request #16 from verypossible/change-base-image-to-python
Browse files Browse the repository at this point in the history
Move base image to python and setup py2 and py3
  • Loading branch information
brianz authored Aug 28, 2017
2 parents 28510ea + 4ba8388 commit 7e0960d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ ENV/

# Rope project settings
.ropeproject
*.swp
18 changes: 8 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

Expand Down
27 changes: 27 additions & 0 deletions Dockerfile-python3
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7e0960d

Please sign in to comment.