blob: 0d317abd076ac38f2f0141be55a76eb7a2750cc7 [file] [log] [blame]
garciadeblas0ce565b2018-10-29 12:22:28 +01001FROM ubuntu:16.04
Mike Marchetti13d76c82018-09-19 15:00:36 -04002
Benjamin Diaz4088a9b2019-05-21 15:11:49 -03003RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor curl software-properties-common libmysqlclient-dev mysql-client
lombardofr8cb84422019-07-16 12:32:01 +02004#RUN npm install -g bower
garciadeblas28f76d92018-11-28 14:15:04 +01005RUN ln -s /usr/bin/nodejs /usr/bin/node
garciadeblas3fad2ea2018-11-29 16:36:50 +01006RUN echo "daemon off;" >> /etc/nginx/nginx.conf
garciadeblas28f76d92018-11-28 14:15:04 +01007
garciadeblas3fad2ea2018-11-29 16:36:50 +01008ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
9ARG RELEASE=ReleaseFOUR-daily
10ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
11ARG REPOSITORY=testing
12ARG LWUI_VERSION
13
14RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
15RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LW-UI" && apt-get update
16
17RUN apt-get install -y osm-lightui${LWUI_VERSION} && \
18 rm -rf /var/lib/apt/lists/*
19
20WORKDIR /usr/share/osm-lightui
lombardofr8cb84422019-07-16 12:32:01 +020021#RUN bower install --allow-root
22RUN npm install
Mike Marchetti13d76c82018-09-19 15:00:36 -040023RUN pip install -r requirements.txt
24RUN pip install uwsgi
garciadeblas0ce565b2018-10-29 12:22:28 +010025RUN cp /usr/share/osm-lightui/nginx-app.conf /etc/nginx/sites-available/default
26RUN cp /usr/share/osm-lightui/supervisor-app.conf /etc/supervisor/conf.d/
Mike Marchetti13d76c82018-09-19 15:00:36 -040027
28# delete the copy of the database inside the container (if exists)
29RUN rm -f db.sqlite3
30
31ENV DJANGO_ENV=prod
Mike Marchetti13d76c82018-09-19 15:00:36 -040032RUN python manage.py collectstatic --noinput
Benjamin Diazc34a5432019-05-24 11:37:22 -030033RUN chmod +x /usr/share/osm-lightui/entrypoint.sh
Mike Marchetti13d76c82018-09-19 15:00:36 -040034
35EXPOSE 80
36
Benjamin Diaz80fa8fa2019-05-24 12:27:10 -030037HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \
38 CMD curl --silent --fail localhost:80 || exit 1
39
Benjamin Diazc34a5432019-05-24 11:37:22 -030040CMD ["/usr/share/osm-lightui/entrypoint.sh"]