| 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 | 0ce565b | 2018-10-29 12:22:28 +0100 | [diff] [blame^] | 3 | WORKDIR /usr/share/osm-lightui |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 4 | |
| 5 | RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor |
| 6 | RUN npm install -g bower |
| Mike Marchetti | 89f2f42 | 2018-09-26 09:58:55 -0400 | [diff] [blame] | 7 | |
| 8 | ARG LWUI_VERSION= |
| garciadeblas | 0ce565b | 2018-10-29 12:22:28 +0100 | [diff] [blame^] | 9 | RUN git clone https://osm.etsi.org/gerrit/osm/LW-UI /usr/share/osm-lightui && echo LWUI_VERSION |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 10 | |
| 11 | RUN ln -s /usr/bin/nodejs /usr/bin/node |
| 12 | RUN bower install --allow-root |
| 13 | |
| 14 | RUN pip install -r requirements.txt |
| 15 | RUN pip install uwsgi |
| 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"] |