blob: 65514e3d7f528f700560d4d373ae69e91ce2c6d1 [file] [log] [blame]
lombardofr7e29d162019-07-30 15:37:33 +02001# Copyright 2019 ETSI
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12# implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
garciadeblas0ce565b2018-10-29 12:22:28 +010016FROM ubuntu:16.04
Mike Marchetti13d76c82018-09-19 15:00:36 -040017
Benjamin Diaz4088a9b2019-05-21 15:11:49 -030018RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor curl software-properties-common libmysqlclient-dev mysql-client
garciadeblas28f76d92018-11-28 14:15:04 +010019RUN ln -s /usr/bin/nodejs /usr/bin/node
garciadeblas3fad2ea2018-11-29 16:36:50 +010020RUN echo "daemon off;" >> /etc/nginx/nginx.conf
garciadeblas28f76d92018-11-28 14:15:04 +010021
garciadeblas3fad2ea2018-11-29 16:36:50 +010022ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
23ARG RELEASE=ReleaseFOUR-daily
24ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
25ARG REPOSITORY=testing
26ARG LWUI_VERSION
27
28RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
29RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LW-UI" && apt-get update
30
31RUN apt-get install -y osm-lightui${LWUI_VERSION} && \
32 rm -rf /var/lib/apt/lists/*
33
34WORKDIR /usr/share/osm-lightui
lombardofr8cb84422019-07-16 12:32:01 +020035RUN npm install
lombardofr7e29d162019-07-30 15:37:33 +020036RUN mv node_modules ./static
Mike Marchetti13d76c82018-09-19 15:00:36 -040037RUN pip install -r requirements.txt
38RUN pip install uwsgi
garciadeblas0ce565b2018-10-29 12:22:28 +010039RUN cp /usr/share/osm-lightui/nginx-app.conf /etc/nginx/sites-available/default
40RUN cp /usr/share/osm-lightui/supervisor-app.conf /etc/supervisor/conf.d/
Mike Marchetti13d76c82018-09-19 15:00:36 -040041
42# delete the copy of the database inside the container (if exists)
43RUN rm -f db.sqlite3
44
45ENV DJANGO_ENV=prod
Mike Marchetti13d76c82018-09-19 15:00:36 -040046RUN python manage.py collectstatic --noinput
Benjamin Diazc34a5432019-05-24 11:37:22 -030047RUN chmod +x /usr/share/osm-lightui/entrypoint.sh
Mike Marchetti13d76c82018-09-19 15:00:36 -040048
49EXPOSE 80
50
Benjamin Diaz80fa8fa2019-05-24 12:27:10 -030051HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \
52 CMD curl --silent --fail localhost:80 || exit 1
53
Benjamin Diazc34a5432019-05-24 11:37:22 -030054CMD ["/usr/share/osm-lightui/entrypoint.sh"]