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