Docker + Angular

 step 1 :Create Docker File 

in that add below commands 

FROM node:20-alpine
WORKDIR /app
RUN npm install -g @angular/cli
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
EXPOSE 4200
CMD ["ng", "serve", "--host", "0.0.0.0"]



step 2: build usng termional

docker build . -t angulartest       


step 3 :

docker run -p 4200:4200 angulartest           






here angulartest means project name available in package.json file 


Ref : https://awstip.com/dockerize-angular-application-without-nginx-6768d3e75db2

Comments

Post a Comment