akveo / ngx-admin

Customizable admin dashboard template based on Angular 10+
https://akveo.github.io/ngx-admin/
MIT License
25.29k stars 7.96k forks source link

Dockerized ngx-admin : long compile on save #5526

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi,

I dockerized your application on an ubuntu VM. With my PC (Windows) I can view the interface on 'http://192.168.xxx.xxx:2007'. The "problem" (if it's one) is that I think the "compile on save" is really long, so I'm wondering if I correctly setup the container.

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. 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?

Thanks in advance!

Container configuration

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

FROM node:12

RUN mkdir /www
WORKDIR /www

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

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

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

Commands :

  1. Get sources and install : git clone https://github.com/akveo/ngx-admin.git /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
bhushankummar commented 3 years ago

Facing the same problem ...