-FROM ubuntu:16.04
+# This Dockerfile is intented for devops and deb package generation
+#
+# Use Dockerfile.local for running osm/NBI in a docker container from source
+# Use Dockerfile.fromdeb for running osm/NBI in a docker container from last stable package
-WORKDIR /usr/src/app
-COPY . /usr/src/app
-RUN apt-get update
-RUN apt-get install -y npm git python-pip nginx supervisor
-RUN npm install -g bower
-RUN ln -s /usr/bin/nodejs /usr/bin/node
-RUN bower install --allow-root
-RUN pip install -r requirements.txt
-RUN pip install uwsgi
+FROM ubuntu:16.04
-RUN echo "daemon off;" >> /etc/nginx/nginx.conf
-COPY nginx-app.conf /etc/nginx/sites-available/default
-COPY supervisor-app.conf /etc/supervisor/conf.d/
+RUN apt-get update && apt-get -y install git make libcurl4-gnutls-dev \
+ libgnutls-dev debhelper apt-utils
-# delete the copy of the database inside the container (if exists)
-RUN rm -f db.sqlite3
-
-ENV DJANGO_ENV=prod
-RUN python manage.py makemigrations authosm
-RUN python manage.py migrate
-RUN python manage.py collectstatic --noinput
-
-
-EXPOSE 80
-
-CMD ["supervisord", "-n"]
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+# Copyright 2018 Telefonica
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+PKG_DIRECTORIES="authosm instancehandler lib projecthandler sdnctrlhandler sf_t3d static template userhandler vimhandler"
+PKG_FILES="bower.json django.ini LICENSE manage.py nginx-app.conf README.md requirements.txt supervisor-app.conf"
+MDG_NAME=lightui
+DEB_INSTALL=debian/osm-${MDG_NAME}.install
+export DEBEMAIL="gerardo.garciadeblas@telefonica.com"
+export DEBFULLNAME="Gerardo Garcia"
+
+PKG_VERSION=$(git describe --match "v*" --tags --abbrev=0)
+PKG_VERSION_PREFIX=$(echo $PKG_VERSION | sed -e 's/v//g')
+PKG_VERSION_POST=$(git rev-list $PKG_VERSION..HEAD | wc -l)
+if [ "$PKG_VERSION_POST" -eq 0 ]; then
+ PKG_DIR="osm-${MDG_NAME}-${PKG_VERSION_PREFIX}"
+else
+ PKG_DIR="osm-${MDG_NAME}-$PKG_VERSION_PREFIX.post${PKG_VERSION_POST}"
+fi
+
+rm -rf $PKG_DIR
+rm -f *.orig.tar.xz
+rm -f *.deb
+rm -f $DEB_INSTALL
+mkdir -p $PKG_DIR
+
+for dir in $PKG_DIRECTORIES; do
+ ln -s $PWD/$dir $PKG_DIR/.
+ echo "$dir/* usr/share/osm-$MDG_NAME/$dir" >> $DEB_INSTALL
+done
+for f in $PKG_FILES; do
+ cp $f $PKG_DIR/.
+ echo "$f usr/share/osm-$MDG_NAME" >> $DEB_INSTALL
+done
+cp -R debian $PKG_DIR/.
+
+cd $PKG_DIR
+dh_make -y --indep --createorig --a -c apache
+dpkg-buildpackage -uc -us -tc -rfakeroot
+cd -
+
--- /dev/null
+Source: osm-lightui
+Section: devel
+Priority: optional
+Maintainer: Gerardo Garcia <gerardio.garciadeblas@telefonica.com>
+Build-Depends: debhelper (>=9)
+Standards-Version: 3.9.6
+Homepage: http://osm.etsi.org
+
+Package: osm-lightui
+Architecture: all
+Depends: ${misc:Depends}
+Description: Open Source MANO Light UI package ...
#!/bin/sh
+# Copyright 2018 Telefonica
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+MDG=LW-UI
+
+rm -rf pool
+rm -rf dists
+mkdir -p pool/$MDG
+mv *.deb pool/$MDG/
+
+mkdir -p dists/unstable/$MDG/binary-amd64/
+apt-ftparchive packages pool/$MDG > dists/unstable/$MDG/binary-amd64/Packages
+gzip -9fk dists/unstable/$MDG/binary-amd64/Packages
echo "ARCHIVE DONE"
+
#!/bin/sh
-#make clean all
+./build-debpkg.sh
echo "BUILD DONE"
--- /dev/null
+FROM ubuntu:16.04
+
+WORKDIR /usr/share/osm-lightui
+COPY . /usr/share/osm-lightui
+
+RUN apt-get update
+RUN apt-get install -y npm git python-pip nginx supervisor
+RUN npm install -g bower
+RUN ln -s /usr/bin/nodejs /usr/bin/node
+RUN bower install --allow-root
+RUN pip install -r requirements.txt
+RUN pip install uwsgi
+
+RUN echo "daemon off;" >> /etc/nginx/nginx.conf
+COPY nginx-app.conf /etc/nginx/sites-available/default
+COPY supervisor-app.conf /etc/supervisor/conf.d/
+
+# delete the copy of the database inside the container (if exists)
+RUN rm -f db.sqlite3
+
+ENV DJANGO_ENV=prod
+RUN python manage.py makemigrations authosm
+RUN python manage.py migrate
+RUN python manage.py collectstatic --noinput
+
+
+EXPOSE 80
+
+CMD ["supervisord", "-n"]
client_max_body_size 75M;
location /static/ {
- alias /usr/src/app/static/;
+ alias /usr/share/osm-lightui/static/;
}
location / {
# log_not_found off;
# access_log off;
# }
-}
\ No newline at end of file
+}
[program:app-uwsgi]
-command = /usr/local/bin/uwsgi --ini /usr/src/app/django.ini
+command = /usr/local/bin/uwsgi --ini /usr/share/osm-lightui/django.ini
environment=DJANGO_ENV="prod"
[program:nginx-app]
-command = /usr/sbin/nginx
\ No newline at end of file
+command = /usr/sbin/nginx