| lombardofr | 1230902 | 2019-07-30 15:37:13 +0200 | [diff] [blame] | 1 | # Copyright 2019 EveryUP |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 12 | # implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| garciadeblas | a70bcf9 | 2018-10-29 12:25:24 +0100 | [diff] [blame] | 16 | FROM ubuntu:16.04 |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 17 | |
| 18 | WORKDIR /usr/share/osm-lightui |
| 19 | COPY . /usr/share/osm-lightui |
| 20 | |
| lombardofr | 1230902 | 2019-07-30 15:37:13 +0200 | [diff] [blame] | 21 | RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor curl software-properties-common libmysqlclient-dev mysql-client |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 22 | RUN ln -s /usr/bin/nodejs /usr/bin/node |
| lombardofr | e5a130a | 2019-07-15 09:17:59 +0200 | [diff] [blame] | 23 | RUN npm install |
| lombardofr | 1230902 | 2019-07-30 15:37:13 +0200 | [diff] [blame] | 24 | RUN mv node_modules ./static |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 25 | RUN pip install -r requirements.txt |
| 26 | RUN pip install uwsgi |
| 27 | |
| 28 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf |
| 29 | COPY nginx-app.conf /etc/nginx/sites-available/default |
| 30 | COPY supervisor-app.conf /etc/supervisor/conf.d/ |
| 31 | |
| 32 | # delete the copy of the database inside the container (if exists) |
| 33 | RUN rm -f db.sqlite3 |
| 34 | |
| 35 | ENV DJANGO_ENV=prod |
| David Garcia | 70f9629 | 2020-01-08 13:14:46 +0100 | [diff] [blame^] | 36 | ENV OSM_SERVER=nbi |
| 37 | # ENV OSMUI_SQL_DATABASE_URI=mysql://root:secret@mysql:3306/lwui |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 38 | RUN python manage.py collectstatic --noinput |
| 39 | |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 40 | EXPOSE 80 |
| 41 | |
| lombardofr | 1230902 | 2019-07-30 15:37:13 +0200 | [diff] [blame] | 42 | CMD ["/usr/share/osm-lightui/entrypoint.sh"] |