Docker Community Forums

Share and learn in the Docker community.

Dockerized angular app : long "compile on save"


I dockerized the ngx-admin Application on an ubuntu VM
With my PC (Windows) I can view the interface on ‘’.
The “problem” (if it’s one) is that I think the “compile on save” is really long : it takes about 40 to 45s to reload the interface after a file has been modified.

I tried to do it locally (on Windows, without docker and run it with “ng serve”) and it only takes 10 or 11 seconds, so I’m wondering if I correctly setup the container.
Is it normal that it takes so long in a container ? Or have I missed something in the container configuration ? How can I not wait 40 seconds every time I change something to see the modifications ? (it’s to long for me)

Thanks in advance!

Container configuration

My Dockerfile (location = /www/pathToDockerFiles/ngx-admin)

FROM node:12

RUN mkdir /www

CMD npm run start
# in package.json = "ng serve --host"

My docker-compose.yml file (location = /www/docker-compose.yml)

  image: my-ngx-admin
    - 2007:4200
    - ./pathToAppsFolders/my_front:/www/

Commands :

1.Get sources and install :
git clone /www/pathToAppsFolders/my_front && cd /www/pathToAppsFolders/my_front && npm install
2. Build the image
cd /www/pathToDockerFiles/ && docker build -t my-ngx-admin -f ngx-admin .
3. Up containers and display
docker-compose up -d && clear && docker ps -a