blob: 8350034c2edb36fd0b2d205ce50b1eb99d1d4564 [file] [log] [blame]
beierlme7646252022-01-13 10:53:08 -05001#######################################################################################
2# Copyright ETSI Contributors and Others.
garciadeblas9887bb42020-06-08 09:55:28 +00003#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
beierlme7646252022-01-13 10:53:08 -050016#######################################################################################
garciadeblas9887bb42020-06-08 09:55:28 +000017
sousaedu6ec3de52021-11-18 13:15:38 +000018FROM ubuntu:18.04 AS BUILD
garciadeblas9887bb42020-06-08 09:55:28 +000019
beierlme7646252022-01-13 10:53:08 -050020ARG APT_PROXY
21RUN if [ ! -z $APT_PROXY ] ; then \
22 echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
23 echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
24 fi
25
David Garciaa60ec732021-03-17 15:28:47 +010026RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
27 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
sousaedufd164af2021-08-12 15:35:51 +010028 apt-transport-https=1.6.* \
29 curl=7.58.* \
30 gnupg2=2.2.* \
31 nginx=1.14.* \
32 software-properties-common=0.96.* \
33 xz-utils=5.2.*
garciadeblas9887bb42020-06-08 09:55:28 +000034
David Garciaa60ec732021-03-17 15:28:47 +010035RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
36 echo "deb https://deb.nodesource.com/node_10.x xenial main" | tee -a /etc/apt/sources.list.d/nodesource.list && \
37 apt-get update && \
garciadeblas6ba74b52021-09-23 17:43:15 +020038 apt-get install -y nodejs=10.24.* \
39 && rm -rf /var/lib/apt/lists/*
garciadeblas9887bb42020-06-08 09:55:28 +000040
David Garciaa60ec732021-03-17 15:28:47 +010041ARG OSM_NGUI_URL
garciadeblas9887bb42020-06-08 09:55:28 +000042
David Garciaa60ec732021-03-17 15:28:47 +010043RUN curl $OSM_NGUI_URL -o osm_ngui.deb
44RUN dpkg -i ./osm_ngui.deb
garciadeblas9887bb42020-06-08 09:55:28 +000045
46WORKDIR /usr/share/osm-ngui
47RUN npm install
Felipe Vicens55911742020-06-23 08:59:42 +020048
garciadeblas9887bb42020-06-08 09:55:28 +000049# Building app.
50RUN npm run build
sousaedu6ec3de52021-11-18 13:15:38 +000051
52FROM ubuntu:18.04 AS FINAL
53
54RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
55 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
56 nginx=1.14.* && \
57 rm -rf /var/lib/apt/lists/*
Felipe Vicens55911742020-06-23 08:59:42 +020058
59# Removing the Nginx default page.
60RUN rm -rf /usr/share/nginx/html/*
61
sousaedu6ec3de52021-11-18 13:15:38 +000062# Copying Nginx configuration
63COPY --from=BUILD /usr/share/osm-ngui/nginx/nginx.conf /etc/nginx/sites-available/default
64
Felipe Vicens55911742020-06-23 08:59:42 +020065# Copying angular build to Nginx default page.
sousaedu6ec3de52021-11-18 13:15:38 +000066COPY --from=BUILD /usr/share/osm-ngui/dist/osm /usr/share/nginx/html
garciadeblas9887bb42020-06-08 09:55:28 +000067
68EXPOSE 80
69
70HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \
71 CMD curl --silent --fail localhost:80 || exit 1
72
73# Starting server.
74CMD ["nginx", "-g", "daemon off;"]