Jhipster application development with Docker and g

2019-06-13 04:50发布

问题:

I am working on a Jhipster application, and am running this application using docker. This is working, however its very cumbersome.

I would like to be able to make UI changes (text, css, html etc) and benefit from gulp and browsersync, that is for example, make a change to an html file, save the file, and have the browser automatically refresh and show the change.

However, the only way I can get changes visible in the browser is to:

1 stop the docker container

2 stop gulp

3 rebuild docker image

4 run docker container

5 view, again, in browser

As you see, it is not optimal.

How then can I streamline this, so that I can either quickly deploy changes into the running docker container, or use gulp to refresh the browser with the changes fronted files?

回答1:

In the file gulp/config.js, you can change the values of uri and apiPort to point at your JHipster app running in a Docker container.

For example, my Docker uses the IP 192.168.99.100, so I would change uri to match that value. Note that the uri needs to include a colon at the end of it.

uri: 'http://192.168.99.100:',