X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FLW-UI.git;a=blobdiff_plain;f=Dockerfile;h=7b28d4bb4bce8edcb6c1cf884eeda2b41cb0a8ec;hp=56b0497fb035f532ff567680e6f0361cd03b84d0;hb=HEAD;hpb=fb37bca4b7e8178c65df2f1496afe372c1d55e78 diff --git a/Dockerfile b/Dockerfile index 56b0497..7b28d4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,23 @@ -FROM python:2.7 +# Copyright 2020 ETSI +# +# 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. +# +# This Dockerfile is intented for devops and deb package generation +# +# Use docker/Dockerfile for running osm/LW-UI in a docker container from source + +FROM ubuntu:18.04 + +RUN apt-get update && apt-get -y install git make debhelper apt-utils dh-make -WORKDIR /usr/src/app -COPY . /usr/src/app - -RUN apt-get update -RUN apt-get -y install npm -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 - - -# delete the copy of the database inside the container (if exists) -RUN rm -f db.sqlite3 - -RUN python manage.py makemigrations sf_user projecthandler instancehandler vimhandler -RUN python manage.py migrate - -RUN python manage.py shell -c "from projecthandler.osm_model import OsmProject; from sf_user.models import CustomUser; CustomUser.objects.create_superuser('admin', 'admin'); admin = CustomUser.objects.get(username='admin'); OsmProject.create_project('admin',admin,True, 'project admin','')" - - -EXPOSE 80 -CMD ["python", "manage.py", "runserver", "0.0.0.0:80"]