| 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 | 3fad2ea | 2018-11-29 16:36:50 +0100 | [diff] [blame^] | 3 | RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor curl software-properties-common |
| garciadeblas | 28f76d9 | 2018-11-28 14:15:04 +0100 | [diff] [blame] | 4 | RUN npm install -g bower |
| garciadeblas | 28f76d9 | 2018-11-28 14:15:04 +0100 | [diff] [blame] | 5 | RUN ln -s /usr/bin/nodejs /usr/bin/node |
| garciadeblas | 3fad2ea | 2018-11-29 16:36:50 +0100 | [diff] [blame^] | 6 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf |
| garciadeblas | 28f76d9 | 2018-11-28 14:15:04 +0100 | [diff] [blame] | 7 | |
| garciadeblas | 3fad2ea | 2018-11-29 16:36:50 +0100 | [diff] [blame^] | 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 |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 22 | RUN pip install -r requirements.txt |
| 23 | RUN pip install uwsgi |
| garciadeblas | 0ce565b | 2018-10-29 12:22:28 +0100 | [diff] [blame] | 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/ |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 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"] |