Skip to content

Commit

Permalink
Merge pull request #711 from rawkode/bugfix/docker-ddev
Browse files Browse the repository at this point in the history
Cleanup Dockerfile's
  • Loading branch information
thinkingserious authored Oct 31, 2018
2 parents 61814dc + ef0c8e0 commit d041c44
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 35 deletions.
20 changes: 8 additions & 12 deletions docker-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
FROM python:3.6-alpine

WORKDIR /root

ENV OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json"
ENV SENDGRID_API_KEY $SENDGRID_API_KEY

RUN apk add --no-cache curl
RUN apk add --update bash && rm -rf /var/cache/apk/*
RUN apk add --update --no-cache bash curl

# install Prism
WORKDIR /root
# Install Prism
ADD https://raw.githubusercontent.com/stoplightio/prism/master/install.sh install.sh
RUN chmod +x ./install.sh && sync && \
./install.sh && \
rm ./install.sh

# set up default sendgrid env
WORKDIR /root
RUN sync && bash install.sh

# Set up default SendGrid env
RUN mkdir sendgrid-python
COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]

ENTRYPOINT ["entrypoint.sh"]
CMD ["--mock"]
Empty file modified docker-test/entrypoint.sh
100644 → 100755
Empty file.
44 changes: 21 additions & 23 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM ubuntu:xenial

WORKDIR /root

ENV PYTHON_VERSIONS='python2.7 python3.4 python3.5 python3.6' \
OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json"
OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json" \
DEBIAN_FRONTEND=noninteractive

# install testing versions of python, including old versions, from deadsnakes
# Install testing versions of python, including old versions, from deadsnakes
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
Expand All @@ -14,35 +18,29 @@ RUN set -x \
&& apt-get purge -y --auto-remove software-properties-common \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /root

# install Prism
# Install Prism
ADD https://raw.githubusercontent.com/stoplightio/prism/master/install.sh install.sh
RUN chmod +x ./install.sh && sync && \
./install.sh && \
rm ./install.sh
RUN sync && bash install.sh

# install pip, tox
# Install pip, tox
ADD https://bootstrap.pypa.io/get-pip.py get-pip.py
RUN python2.7 get-pip.py && \
pip install tox && \
rm get-pip.py
RUN python2.7 get-pip.py && pip install tox

#install pyyaml, six, werkzeug
RUN python3.6 -m pip install pyyaml
RUN python3.6 -m pip install six
RUN Python3.6 -m pip install werkzeug
RUN Python3.6 -m pip install flask
# Install pyyaml, six, werkzeug
RUN python3.6 -m pip install pyyaml six werkzeug flask

# set up default sendgrid env
# Set up default SendGrid env
WORKDIR /root/sources
RUN git clone https://github.com/sendgrid/sendgrid-python.git && \
git clone https://github.com/sendgrid/python-http-client.git

RUN git clone https://github.com/sendgrid/sendgrid-python.git \
&& git clone https://github.com/sendgrid/python-http-client.git

WORKDIR /root
RUN ln -s /root/sources/sendgrid-python/sendgrid && \
ln -s /root/sources/python-http-client/python_http_client

RUN ln -s /root/sources/sendgrid-python/sendgrid \
&& ln -s /root/sources/python-http-client/python_http_client

COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]
CMD ["--mock"]
Empty file modified docker/entrypoint.sh
100644 → 100755
Empty file.

0 comments on commit d041c44

Please sign in to comment.