| beierlm | e764625 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 1 | ####################################################################################### |
| 2 | # Copyright ETSI Contributors and Others. |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 3 | # |
| 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. |
| beierlm | e764625 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 16 | ####################################################################################### |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 17 | |
| garciadeblas | ecc48d9 | 2023-06-08 17:23:24 +0200 | [diff] [blame] | 18 | FROM ubuntu:22.04 as INSTALL |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 19 | |
| beierlm | e764625 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 20 | ARG APT_PROXY |
| 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 ;\ |
| 24 | fi |
| 25 | |
| David Garcia | a60ec73 | 2021-03-17 15:28:47 +0100 | [diff] [blame] | 26 | RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ |
| 27 | DEBIAN_FRONTEND=noninteractive apt-get --yes install \ |
| garciadeblas | ecc48d9 | 2023-06-08 17:23:24 +0200 | [diff] [blame] | 28 | apt-transport-https=2.4.* \ |
| 29 | curl=7.81.* \ |
| sousaedu | fd164af | 2021-08-12 15:35:51 +0100 | [diff] [blame] | 30 | gnupg2=2.2.* \ |
| beierlm | d744936 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 31 | nginx=1.18.* \ |
| 32 | software-properties-common=0.99.* \ |
| garciadeblas | ecc48d9 | 2023-06-08 17:23:24 +0200 | [diff] [blame] | 33 | xz-utils=5.2.* \ |
| 34 | && rm -rf /var/lib/apt/lists/* |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 35 | |
| David Garcia | a60ec73 | 2021-03-17 15:28:47 +0100 | [diff] [blame] | 36 | RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ |
| garciadeblas | ecc48d9 | 2023-06-08 17:23:24 +0200 | [diff] [blame] | 37 | echo "deb https://deb.nodesource.com/node_14.x jammy main" | tee -a /etc/apt/sources.list.d/nodesource.list && \ |
| beierlm | d744936 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 38 | DEBIAN_FRONTEND=noninteractive apt-get update && \ |
| SANDHYA.JS | 8177b9c | 2023-04-26 09:48:39 +0530 | [diff] [blame] | 39 | DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 40 | |
| David Garcia | a60ec73 | 2021-03-17 15:28:47 +0100 | [diff] [blame] | 41 | ARG OSM_NGUI_URL |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 42 | |
| David Garcia | a60ec73 | 2021-03-17 15:28:47 +0100 | [diff] [blame] | 43 | RUN curl $OSM_NGUI_URL -o osm_ngui.deb |
| 44 | RUN dpkg -i ./osm_ngui.deb |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 45 | |
| 46 | WORKDIR /usr/share/osm-ngui |
| 47 | RUN npm install |
| Felipe Vicens | 5591174 | 2020-06-23 08:59:42 +0200 | [diff] [blame] | 48 | |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 49 | # Building app. |
| 50 | RUN npm run build |
| sousaedu | 6ec3de5 | 2021-11-18 13:15:38 +0000 | [diff] [blame] | 51 | |
| beierlm | d744936 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 52 | ####################################################################################### |
| garciadeblas | ecc48d9 | 2023-06-08 17:23:24 +0200 | [diff] [blame] | 53 | FROM ubuntu:22.04 AS FINAL |
| beierlm | d744936 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 54 | |
| 55 | ARG APT_PROXY |
| 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 ;\ |
| 59 | fi |
| sousaedu | 6ec3de5 | 2021-11-18 13:15:38 +0000 | [diff] [blame] | 60 | |
| 61 | RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ |
| 62 | DEBIAN_FRONTEND=noninteractive apt-get --yes install \ |
| beierlm | d744936 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 63 | nginx=1.18.* && \ |
| sousaedu | 6ec3de5 | 2021-11-18 13:15:38 +0000 | [diff] [blame] | 64 | rm -rf /var/lib/apt/lists/* |
| Felipe Vicens | 5591174 | 2020-06-23 08:59:42 +0200 | [diff] [blame] | 65 | |
| Mark Beierl | e5b9ba6 | 2022-09-08 05:44:06 -0400 | [diff] [blame] | 66 | RUN rm -f /etc/apt/apt.conf.d/proxy.conf |
| 67 | |
| Felipe Vicens | 5591174 | 2020-06-23 08:59:42 +0200 | [diff] [blame] | 68 | # Removing the Nginx default page. |
| 69 | RUN rm -rf /usr/share/nginx/html/* |
| 70 | |
| sousaedu | 6ec3de5 | 2021-11-18 13:15:38 +0000 | [diff] [blame] | 71 | # Copying Nginx configuration |
| beierlm | d744936 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 72 | COPY --from=INSTALL /usr/share/osm-ngui/nginx/nginx.conf /etc/nginx/sites-available/default |
| sousaedu | 6ec3de5 | 2021-11-18 13:15:38 +0000 | [diff] [blame] | 73 | |
| Felipe Vicens | 5591174 | 2020-06-23 08:59:42 +0200 | [diff] [blame] | 74 | # Copying angular build to Nginx default page. |
| beierlm | d744936 | 2022-01-13 10:53:08 -0500 | [diff] [blame] | 75 | COPY --from=INSTALL /usr/share/osm-ngui/dist/osm /usr/share/nginx/html |
| garciadeblas | 9887bb4 | 2020-06-08 09:55:28 +0000 | [diff] [blame] | 76 | |
| 77 | EXPOSE 80 |
| 78 | |
| 79 | HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \ |
| 80 | CMD curl --silent --fail localhost:80 || exit 1 |
| 81 | |
| 82 | # Starting server. |
| 83 | CMD ["nginx", "-g", "daemon off;"] |