1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
18 FROM ubuntu:22.04 as INSTALL
21 RUN 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 ;\
26 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
27 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
28 apt-transport-https=2.4.* \
32 software-properties-common=0.99.* \
34 && rm -rf /var/lib/apt/lists/*
36 RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
37 echo "deb https://deb.nodesource.com/node_14.x jammy main" | tee -a /etc/apt/sources.list.d/nodesource.list && \
38 DEBIAN_FRONTEND=noninteractive apt-get update && \
39 DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
43 RUN curl $OSM_NGUI_URL -o osm_ngui.deb
44 RUN dpkg -i ./osm_ngui.deb
46 WORKDIR /usr/share/osm-ngui
52 #######################################################################################
53 FROM ubuntu:22.04 AS FINAL
56 RUN if [ ! -z $APT_PROXY ] ; then \
57 echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
58 echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
61 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
62 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
64 rm -rf /var/lib/apt/lists/*
66 RUN rm -f /etc/apt/apt.conf.d/proxy.conf
68 # Removing the Nginx default page.
69 RUN rm -rf /usr/share/nginx/html/*
71 # Copying Nginx configuration
72 COPY --from=INSTALL /usr/share/osm-ngui/nginx/nginx.conf /etc/nginx/sites-available/default
74 # Copying angular build to Nginx default page.
75 COPY --from=INSTALL /usr/share/osm-ngui/dist/osm /usr/share/nginx/html
79 HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \
80 CMD curl --silent --fail localhost:80 || exit 1
83 CMD ["nginx", "-g", "daemon off;"]