Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Dockerfile's #711

Merged
merged 1 commit into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.