| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | # Copyright 2020 TATA ELXSI |
| 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 | # Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in), VIJAY NAG (vijaynag.bs@tataelxsi.co.in) |
| 17 | |
| SANDHYA.JS | eb33148 | 2023-05-02 14:47:59 +0530 | [diff] [blame] | 18 | FROM ubuntu:22.04 |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 19 | # Installing node dependencies. |
| 20 | RUN apt-get update && apt-get install -y curl xz-utils gnupg2 \ |
| 21 | && apt-get update && apt-get install -y apt-transport-https \ |
| 22 | && curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ |
| SANDHYA.JS | eb5228b | 2022-03-31 08:56:04 +0530 | [diff] [blame] | 23 | && echo "deb https://deb.nodesource.com/node_14.x focal main" | tee -a /etc/apt/sources.list.d/nodesource.list \ |
| 24 | && echo "deb-src https://deb.nodesource.com/node_14.x focal main" | tee -a /etc/apt/sources.list.d/nodesource.list \ |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 25 | && apt-get update && apt-get install -y nodejs \ |
| 26 | && apt-get install -y nginx |
| 27 | |
| bravof | cedffec | 2021-05-05 16:50:46 -0400 | [diff] [blame] | 28 | RUN npm install -g yarn |
| 29 | |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 30 | # Preparing working environment. |
| 31 | RUN mkdir -p /usr/src/osm-angularapp |
| 32 | WORKDIR /usr/src/osm-angularapp |
| 33 | |
| 34 | # Installing dependencies. |
| 35 | COPY ./package.json /usr/src/osm-angularapp/ |
| bravof | cedffec | 2021-05-05 16:50:46 -0400 | [diff] [blame] | 36 | RUN yarn install |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 37 | |
| 38 | # Copy osm-angularapp source into image. |
| 39 | COPY ./ /usr/src/osm-angularapp |
| 40 | |
| 41 | # Building app. |
| bravof | cedffec | 2021-05-05 16:50:46 -0400 | [diff] [blame] | 42 | RUN yarn build |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 43 | |
| 44 | # Removing nginx default page. |
| 45 | RUN rm -rf /usr/share/nginx/html/* |
| 46 | |
| 47 | # Copying nginx configuration. |
| 48 | COPY nginx/nginx.conf /etc/nginx/sites-available/default |
| 49 | RUN cp -r /usr/src/osm-angularapp/dist/osm/* /usr/share/nginx/html |
| 50 | |
| 51 | # Exposing ports. |
| 52 | EXPOSE 80 |
| 53 | |
| 54 | # Starting server. |
| 55 | CMD ["nginx", "-g", "daemon off;"] |
| 56 | |