I tried ignoring the node_modules but still is not working for me ,even after ignoring the node_modules im still facing the same error
yaml file:
version: '3.5'
services:
angular-docker:
hostname: localhost
container_name: angular-docker
build: ./angular-doc
volumes:
- './angular-doc:/usr/src/app/'
ports:
- '4200:4200'
docker file:
FROM node:10.12.0
RUN mkdir usr/src/app
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install -g @angular/cli@latest
COPY . .
EXPOSE 4200
CMD ng serve --host 0.0.0.0
You need to install @angular-devkit/build-angular package as dev dependency in your angular project
npm install --save-dev @angular-devkit/build-angular
Updated!
you have forget to add RUN npm install
in the docker file
FROM node:10.12.0
RUN mkdir usr/src/app
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
RUN npm install -g @angular/cli@latest
COPY . .
EXPOSE 4200
CMD ng serve --host 0.0.0.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With