Angular 9 Dockerizing

I have problem with dockerizing Angular 9.

Dockerfile:

#############
### build ###
#############

# base image
FROM node:12.2.0 as build

# install chrome for protractor tests
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >>     /etc/apt/sources.list.d/google.list'
RUN apt-get update && apt-get install -yq google-chrome-stable

# set working directory
WORKDIR /app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /app/package.json
RUN npm install
RUN npm install -g @angular/[email protected]

# add app
COPY . /app

# run tests
#RUN ng test --watch=false
#RUN ng e2e --port 4202

# generate build
RUN ng build --output-path=dist

############
### prod ###
############

# base image
FROM nginx:1.16.0-alpine

# copy artifact build from the 'build environment'
COPY --from=build /app/dist /usr/share/nginx/html

# expose port 80
EXPOSE 80

# run nginx
CMD ["nginx", "-g", "daemon off;"]

I tested that file on my machine: OS Ubuntu 18.04 LTS, 16GB Ram

Now i have to deploy that image to VPS which i bought on Digital Ocean.

VPS conf: 1 CPU, 2GB Ram, 25GB HDD; OS: Ubuntu 18.04 LTS

But when I’m trying to build an image on my VPS using this Dockerfile

It throws an error:

Generating ES5 bundles for differential loading...
An unhandled exception occurred: Call retries were exceeded
See "/tmp/ng-1cdowd/angular-errors.log" for further details.
The command '/bin/sh -c ng build --output-path=dist' returned a non-zero code: 127

Source: StackOverflow