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