Docker Community Forums

Share and learn in the Docker community.

Angular app on docker is throwing error on serve command

I am trying to run angular app on docker . Below is my dockerfile .

base image

FROM node:12.2.0
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json /app/package.json
RUN npm install
RUN echo “Test”
COPY . /app
CMD ng serve

building image is successful. When i try to run the image, i am getting below error
Command used for run :
docker run -d -v ${PWD}:/app -v /app/node_modules -p 4201:4200 angapp2

getting error as below :
The serve command requires to be run in an Angular project, but a project defini
tion could not be found

Did you ever figure this out?