diff options
author | Stamatis Katsaounis <mokats@intracom-telecom.com> | 2018-08-23 15:48:11 +0300 |
---|---|---|
committer | Stamatis Katsaounis <mokats@intracom-telecom.com> | 2018-08-23 15:51:03 +0300 |
commit | 08d5f508d3bc323faefdfd56451566ff724ddc2f (patch) | |
tree | 8a868c6236b26d66ed62c55cc501928bb2003076 | |
parent | e2e5f5e2c53c03630b3128796bd7db7809bd93bd (diff) |
Improve Dockerfiles to be more efficient.
Change-Id: I1739e75d94b0e3f7b4c411ded2fb911e4195da12
Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
-rw-r--r-- | docker/Dockerfile.api | 45 | ||||
-rw-r--r-- | docker/Dockerfile.web | 37 |
2 files changed, 35 insertions, 47 deletions
diff --git a/docker/Dockerfile.api b/docker/Dockerfile.api index a577a49..4840739 100644 --- a/docker/Dockerfile.api +++ b/docker/Dockerfile.api @@ -33,37 +33,30 @@ ENV HOME /home # Packaged dependencies RUN apt-get update && apt-get install -y \ -curl \ -git \ -gcc \ -wget \ -python-dev \ -python-pip \ -crudini \ -libffi-dev \ -libssl-dev \ -libxml2-dev \ -libxslt1-dev \ ---no-install-recommends + curl \ + git \ + gcc \ + wget \ + python-dev \ + python-pip \ + crudini \ + libffi-dev \ + libssl-dev \ + libxml2-dev \ + libxslt1-dev \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* RUN pip install -U setuptools -WORKDIR /home +RUN git config --global http.sslVerify false && \ + git clone https://gerrit.opnfv.org/gerrit/dovetail-webportal $HOME/testapi && \ + cd $HOME/testapi && \ + git checkout -f $BRANCH && \ + mkdir -p $HOME/testapi/logs/api -#RUN pip install --upgrade pip +WORKDIR $HOME/testapi -RUN git config --global http.sslVerify false - -RUN git clone https://gerrit.opnfv.org/gerrit/dovetail-webportal - -WORKDIR /home/dovetail-webportal -RUN git checkout -f $BRANCH - -RUN mkdir -p /home/testapi -RUN mkdir -p /home/testapi/logs/api -RUN cp -rf /home/dovetail-webportal/* /home/testapi - -WORKDIR /home/dovetail-webportal RUN pip install -r requirements.txt RUN bash install.sh diff --git a/docker/Dockerfile.web b/docker/Dockerfile.web index 438ada6..d4b604e 100644 --- a/docker/Dockerfile.web +++ b/docker/Dockerfile.web @@ -12,31 +12,26 @@ LABEL version="v2" description="OVP nginx" ARG BRANCH=master ENV HOME /home -WORKDIR /home - -RUN apt-get update - -RUN apt-get install -y git nginx supervisor - -RUN git config --global http.sslVerify false -RUN git clone https://gerrit.opnfv.org/gerrit/dovetail-webportal - -WORKDIR /home/dovetail-webportal -RUN git checkout -f $BRANCH - -RUN mkdir -p /home/testapi - -RUN cp -rf /home/dovetail-webportal/* /home/testapi - -RUN mkdir /www -RUN cp -r /home/testapi/3rd_party/static /www/ - +WORKDIR $HOME + +# Packaged dependencies +RUN apt-get update && apt-get install -y \ + git \ + nginx \ + supervisor \ + && rm -rf /var/lib/apt/lists/* + +RUN git config --global http.sslVerify false && \ + git clone https://gerrit.opnfv.org/gerrit/dovetail-webportal $HOME/testapi && \ + cd $HOME/testapi && \ + git checkout -f $BRANCH && \ + mkdir /www && \ + cp -r $HOME/testapi/3rd_party/static /www/ ADD nginx/nginx.conf /etc/nginx/nginx.conf ADD nginx/sites-enabled/default /etc/nginx/sites-available/default ADD nginx/sites-enabled/default /etc/nginx/sites-enabled/default ADD supervisor/conf.d/nginx.conf /etc/supervisor/conf.d/nginx.conf -ADD start-nginx.sh /home/start-nginx.sh +ADD start-nginx.sh $HOME/start-nginx.sh -WORKDIR /home CMD ["bash", "start-nginx.sh"] |