blob: 24ffe1caf01993de286174d27ee38a91d6f2856d [file] [log] [blame]
garciadeblas9887bb42020-06-08 09:55:28 +00001# 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
16FROM ubuntu:18.04
17
David Garciaa60ec732021-03-17 15:28:47 +010018RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
19 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
20 apt-transport-https=1.6.12ubuntu0.2 \
21 curl=7.58.0-2ubuntu3.13 \
22 gnupg2=2.2.4-1ubuntu1.4 \
23 nginx=1.14.0-0ubuntu1.7 \
24 software-properties-common=0.96.24.32.14 \
25 xz-utils=5.2.2-1.3
garciadeblas9887bb42020-06-08 09:55:28 +000026
David Garciaa60ec732021-03-17 15:28:47 +010027RUN 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 && \
beierlm898620c2021-04-06 20:05:30 -040030 apt-get install -y nodejs=10.24.1-1nodesource1
garciadeblas9887bb42020-06-08 09:55:28 +000031
David Garciaa60ec732021-03-17 15:28:47 +010032ARG OSM_NGUI_URL
garciadeblas9887bb42020-06-08 09:55:28 +000033
David Garciaa60ec732021-03-17 15:28:47 +010034RUN curl $OSM_NGUI_URL -o osm_ngui.deb
35RUN dpkg -i ./osm_ngui.deb
garciadeblas9887bb42020-06-08 09:55:28 +000036
37WORKDIR /usr/share/osm-ngui
38RUN npm install
Felipe Vicens55911742020-06-23 08:59:42 +020039
garciadeblas9887bb42020-06-08 09:55:28 +000040# Building app.
41RUN npm run build
Felipe Vicens55911742020-06-23 08:59:42 +020042RUN cp /usr/share/osm-ngui/nginx/nginx.conf /etc/nginx/sites-available/default
43
44# Removing the Nginx default page.
45RUN rm -rf /usr/share/nginx/html/*
46
47# Copying angular build to Nginx default page.
48RUN cp -r /usr/share/osm-ngui/dist/osm/* /usr/share/nginx/html
garciadeblas9887bb42020-06-08 09:55:28 +000049
50EXPOSE 80
51
52HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \
53 CMD curl --silent --fail localhost:80 || exit 1
54
55# Starting server.
56CMD ["nginx", "-g", "daemon off;"]