1 # Copyright 2020 TATA ELXSI
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
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)
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 - \
23 && echo "deb https://deb.nodesource.com/node_10.x xenial main" | tee -a /etc/apt/sources.list.d/nodesource.list \
24 && echo "deb-src https://deb.nodesource.com/node_10.x xenial main" | tee -a /etc/apt/sources.list.d/nodesource.list \
25 && apt-get update && apt-get install -y nodejs \
26 && apt-get install -y nginx
28 # Preparing working environment.
29 RUN mkdir -p /usr/src/osm-angularapp
30 WORKDIR /usr/src/osm-angularapp
32 # Installing dependencies.
33 COPY ./package.json /usr/src/osm-angularapp/
36 # Copy osm-angularapp source into image.
37 COPY ./ /usr/src/osm-angularapp
42 # Removing nginx default page.
43 RUN rm -rf /usr/share/nginx/html/*
45 # Copying nginx configuration.
46 COPY nginx/nginx.conf /etc/nginx/sites-available/default
47 RUN cp -r /usr/src/osm-angularapp/dist/osm/* /usr/share/nginx/html
53 CMD ["nginx", "-g", "daemon off;"]