Skip to content

Build and run Shanoir front with docker compose via volume sharing

Julien Louis edited this page Apr 16, 2019 · 7 revisions

Developing the front with your favorite IDE on the host machine is much easier. Each time you make some changes in your IDE and to see the results, you should normally re-build with maven the front project and then do a docker-compose up --build with your new code. But, how many coffees should you take to wait for the results each time?! Here is some little tips to avoid your waiting time:

  1. In the Dockerfile of the \docker-compose\nginx folder, comment the last line like this:

#COPY webapp/ /etc/nginx/html/

  1. In the docker-compose.yml file, in the Nginx part, add the following line in the "volumes" part:

- "C:/Users/yyao/git/shanoir-ng/shanoir-ng-front/dist:/etc/nginx/html:ro" So when the nginx container is created, we tell Docker to mount a local directory of the front on the host side to the nginx container. Now any changes made to the files in the local directory "/dist" are reflected in the nginx container.

  1. Make some changes in the front and run "npm run build:dev".

3.5 Take a coffee but a short one :)

  1. Shift + F5 in your favorite navigator and you see your changes here!
Clone this wiki locally