| garciadeblas | 0ce565b | 2018-10-29 12:22:28 +0100 | [diff] [blame] | 1 | FROM ubuntu:16.04 |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 2 | |
| garciadeblas | d3a9541 | 2018-11-20 18:29:12 +0100 | [diff] [blame] | 3 | WORKDIR /usr/share/osm-lightui |
| garciadeblas | 28f76d9 | 2018-11-28 14:15:04 +0100 | [diff] [blame] | 4 | |
| 5 | RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor |
| 6 | RUN npm install -g bower |
| 7 | |
| 8 | ARG LWUI_VERSION= |
| 9 | RUN git clone https://osm.etsi.org/gerrit/osm/LW-UI /usr/share/osm-lightui && echo LWUI_VERSION |
| 10 | |
| 11 | RUN ln -s /usr/bin/nodejs /usr/bin/node |
| garciadeblas | d3a9541 | 2018-11-20 18:29:12 +0100 | [diff] [blame] | 12 | RUN bower install --allow-root |
| garciadeblas | 28f76d9 | 2018-11-28 14:15:04 +0100 | [diff] [blame] | 13 | |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 14 | RUN pip install -r requirements.txt |
| 15 | RUN pip install uwsgi |
| garciadeblas | 28f76d9 | 2018-11-28 14:15:04 +0100 | [diff] [blame] | 16 | # |
| 17 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf |
| garciadeblas | 0ce565b | 2018-10-29 12:22:28 +0100 | [diff] [blame] | 18 | RUN cp /usr/share/osm-lightui/nginx-app.conf /etc/nginx/sites-available/default |
| 19 | RUN cp /usr/share/osm-lightui/supervisor-app.conf /etc/supervisor/conf.d/ |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 20 | |
| 21 | # delete the copy of the database inside the container (if exists) |
| 22 | RUN rm -f db.sqlite3 |
| 23 | |
| 24 | ENV DJANGO_ENV=prod |
| 25 | RUN python manage.py makemigrations authosm |
| 26 | RUN python manage.py migrate |
| 27 | RUN python manage.py collectstatic --noinput |
| 28 | |
| 29 | |
| 30 | EXPOSE 80 |
| 31 | |
| 32 | CMD ["supervisord", "-n"] |