Can’t build angular dist, if nginx is running (dockerized)

The setup

I have 2 docker containers running on Windows 8.1

One containing npm for building an angular project.
The other containing nginx, serving the dist directory.

The dist directory is in /var/www/front, shared by both containers in volumes.

Here’s the docker-compose config :

nginx:
    build: ./docker/nginx
    ports:
        - "80:80"
        - "8080:8080"
    environment:
        APP_ENV: prod
    volumes:
        - ./logs/nginx:/var/log/nginx:cached
        - ./back:/var/www/back
        - ./front:/var/www/front
node:
    build: ./docker/node
    ports:
        - "4200:4200"
    volumes:
        - ./front:/var/www/front
        - /var/www/front/node_modules/

The issue

When nginx container is running and only when the page is displayed on the browser, ng build won’t build the angular project, failing with a “conflict” error :

ETXTBSY: text file is busy, unlink '/var/www/front/dist/assets/image.jpg

Is there a workaround to this issue?

Source: StackOverflow