diff options
Diffstat (limited to 'docker/Dockerfile')
-rw-r--r-- | docker/Dockerfile | 67 |
1 files changed, 41 insertions, 26 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index c5239dbb..6d6a7db7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,54 +1,69 @@ -FROM ubuntu:14.04 -MAINTAINER Leo Wang <grakiss.wanglei@huawei.com> +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +FROM ubuntu:18.04 +MAINTAINER Stamatis Katsaounis <mokats@intracom-telecom.com> LABEL version="0.1" description="OPNFV Dovetail Docker Container" ARG BRANCH=master +ARG SWAGGER_UI_TAG=v3.22.3 RUN \ apt-get update \ && \ apt-get install -y \ - build-essential \ + apache2 \ gcc \ + make \ git \ libssl-dev \ libffi-dev \ vim \ - python-dev \ - python-mock \ - python-pip \ - apt-transport-https \ - wget \ + python3-dev \ + python3-pip \ --no-install-recommends \ && \ - apt-get update - -RUN easy_install -U setuptools==30.0.0 + rm -rf /var/lib/apt/lists/* -RUN wget -qO- https://get.docker.com/ \ -| \ - sed 's/-q docker-ce/-q docker-ce=17.03.0~ce-0~ubuntu-trusty/' \ -| \ - sed 's/edge/stable/' \ -| \ - sh +RUN pip3 install -U setuptools wheel +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 ENV HOME /home/opnfv ENV REPOS_DIR ${HOME}/dovetail -WORKDIR /home/opnfv +ENV API_DIR ${REPOS_DIR}/dovetail/api +WORKDIR $HOME RUN \ mkdir -p ${REPOS_DIR} \ && \ - git config --global http.sslVerify false \ + git init /tmp/dovetail \ +&& \ + (cd /tmp/dovetail && \ + git fetch --tags https://gerrit.opnfv.org/gerrit/dovetail $BRANCH && \ + git checkout FETCH_HEAD && \ + pip3 install .) \ && \ - pip install git+https://git.opnfv.org/dovetail@$BRANCH#egg=dovetail \ + rm -rf /tmp/dovetail \ +&& \ + ln -s /usr/local/lib/python3.6/dist-packages/dovetail ${REPOS_DIR}/dovetail + +RUN \ + git clone https://github.com/swagger-api/swagger-ui.git \ && \ - ln -s /usr/local/lib/python2.7/dist-packages/dovetail ${REPOS_DIR}/dovetail + cd swagger-ui && git checkout $SWAGGER_UI_TAG WORKDIR ${REPOS_DIR}/dovetail -# get db schema from opnfv sites -# RUN mkdir -p ${REPOS_DIR}/dovetail/utils/local_db -# ADD get_db_schema.py ${REPOS_DIR}/dovetail/utils/local_db -# RUN cd ${REPOS_DIR}/dovetail/utils/local_db && python get_db_schema.py +ENV FLASK_APP ${API_DIR}/app/routes.py +# This port is for flask API in container +EXPOSE 5000 +# This port is for Swagger UI in container +EXPOSE 80 +CMD bash ${API_DIR}/boot.sh |