blob: ff8017d1c6a12ea4f5a532b119dd4bb1c61c2d4c [file] [log] [blame]
kumaran.m3b4814a2020-05-01 19:48:54 +05301# 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.JS86be6392022-03-31 08:56:04 +053018FROM ubuntu:20.04
kumaran.m3b4814a2020-05-01 19:48:54 +053019# Installing node dependencies.
20RUN 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.JS86be6392022-03-31 08:56:04 +053023 && 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.m3b4814a2020-05-01 19:48:54 +053025 && apt-get update && apt-get install -y nodejs \
26 && apt-get install -y nginx
27
bravofcedffec2021-05-05 16:50:46 -040028RUN npm install -g yarn
29
kumaran.m3b4814a2020-05-01 19:48:54 +053030# Preparing working environment.
31RUN mkdir -p /usr/src/osm-angularapp
32WORKDIR /usr/src/osm-angularapp
33
34# Installing dependencies.
35COPY ./package.json /usr/src/osm-angularapp/
bravofcedffec2021-05-05 16:50:46 -040036RUN yarn install
kumaran.m3b4814a2020-05-01 19:48:54 +053037
38# Copy osm-angularapp source into image.
39COPY ./ /usr/src/osm-angularapp
40
41# Building app.
bravofcedffec2021-05-05 16:50:46 -040042RUN yarn build
kumaran.m3b4814a2020-05-01 19:48:54 +053043
44# Removing nginx default page.
45RUN rm -rf /usr/share/nginx/html/*
46
47# Copying nginx configuration.
48COPY nginx/nginx.conf /etc/nginx/sites-available/default
49RUN cp -r /usr/src/osm-angularapp/dist/osm/* /usr/share/nginx/html
50
51# Exposing ports.
52EXPOSE 80
53
54# Starting server.
55CMD ["nginx", "-g", "daemon off;"]
56