| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 1 | # Copyright 2020 ETSI |
| 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 | |
| 16 | FROM ubuntu:18.04 |
| 17 | |
| David Garcia | a60ec73 | 2021-03-17 15:28:47 +0100 | [diff] [blame] | 18 | RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ |
| 19 | DEBIAN_FRONTEND=noninteractive apt-get --yes install \ |
| sousaedu | fd164af | 2021-08-12 15:35:51 +0100 | [diff] [blame] | 20 | apt-transport-https=1.6.* \ |
| 21 | curl=7.58.* \ |
| 22 | gnupg2=2.2.* \ |
| 23 | nginx=1.14.* \ |
| 24 | software-properties-common=0.96.* \ |
| 25 | xz-utils=5.2.* |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 26 | |
| David Garcia | a60ec73 | 2021-03-17 15:28:47 +0100 | [diff] [blame] | 27 | RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ |
| 28 | echo "deb https://deb.nodesource.com/node_10.x xenial main" | tee -a /etc/apt/sources.list.d/nodesource.list && \ |
| 29 | apt-get update && \ |
| garciadeblas | 6ba74b5 | 2021-09-23 17:43:15 +0200 | [diff] [blame^] | 30 | apt-get install -y nodejs=10.24.* \ |
| 31 | && rm -rf /var/lib/apt/lists/* |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 32 | |
| David Garcia | a60ec73 | 2021-03-17 15:28:47 +0100 | [diff] [blame] | 33 | ARG OSM_NGUI_URL |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 34 | |
| David Garcia | a60ec73 | 2021-03-17 15:28:47 +0100 | [diff] [blame] | 35 | RUN curl $OSM_NGUI_URL -o osm_ngui.deb |
| 36 | RUN dpkg -i ./osm_ngui.deb |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 37 | |
| 38 | WORKDIR /usr/share/osm-ngui |
| 39 | RUN npm install |
| Felipe Vicens | 5591174 | 2020-06-23 08:59:42 +0200 | [diff] [blame] | 40 | |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 41 | # Building app. |
| 42 | RUN npm run build |
| Felipe Vicens | 5591174 | 2020-06-23 08:59:42 +0200 | [diff] [blame] | 43 | RUN cp /usr/share/osm-ngui/nginx/nginx.conf /etc/nginx/sites-available/default |
| 44 | |
| 45 | # Removing the Nginx default page. |
| 46 | RUN rm -rf /usr/share/nginx/html/* |
| 47 | |
| 48 | # Copying angular build to Nginx default page. |
| 49 | RUN cp -r /usr/share/osm-ngui/dist/osm/* /usr/share/nginx/html |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 50 | |
| 51 | EXPOSE 80 |
| 52 | |
| 53 | HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \ |
| 54 | CMD curl --silent --fail localhost:80 || exit 1 |
| 55 | |
| 56 | # Starting server. |
| 57 | CMD ["nginx", "-g", "daemon off;"] |