Merge "Adds healthcheck to MON Dockerfile"
[osm/devops.git] / docker / light-ui / Dockerfile
1 FROM ubuntu:16.04
2
3 RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor curl software-properties-common
4 RUN npm install -g bower
5 RUN ln -s /usr/bin/nodejs /usr/bin/node
6 RUN echo "daemon off;" >> /etc/nginx/nginx.conf
7
8 ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
9 ARG RELEASE=ReleaseFOUR-daily
10 ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
11 ARG REPOSITORY=testing
12 ARG LWUI_VERSION
13
14 RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
15 RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LW-UI" && apt-get update
16
17 RUN apt-get install -y osm-lightui${LWUI_VERSION} && \
18     rm -rf /var/lib/apt/lists/*
19
20 WORKDIR /usr/share/osm-lightui
21 RUN bower install --allow-root
22 RUN pip install -r requirements.txt
23 RUN pip install uwsgi
24 RUN cp /usr/share/osm-lightui/nginx-app.conf /etc/nginx/sites-available/default
25 RUN cp /usr/share/osm-lightui/supervisor-app.conf /etc/supervisor/conf.d/
26
27 # delete the copy of the database inside the container (if exists)
28 RUN rm -f db.sqlite3
29
30 ENV DJANGO_ENV=prod
31 RUN python manage.py makemigrations authosm
32 RUN python manage.py migrate
33 RUN python manage.py collectstatic --noinput
34
35
36 EXPOSE 80
37
38 CMD ["supervisord", "-n"]