'Meteor build refresh after file change saving drops an EACCES error in a docker container

SUMMARY

First of all I run my Meteor web app using docker-compose with docker-compose -f docker-file.dev.yml up -d --build. Everything works fine for the first build. The app is reachable on my browser via localhost.

Then I have an EACESS error while I use my code editor (vscode) to edit some .jsx files, this runs the build refresh, then, the application, running in a docker container crashes. It means I have a permission error. But, when I save an updated file, this is done with my current (windows) user into VSCode, anyway, the app is run by "meteoruser" user defined in the docker-compose.dev.yml file below.

So what is the problem with this configuration, it worked well on a previous computer running ubuntu 16.04. Is windows the problem?

If I check docker logs I have this output :

enter image description here

If I rerun docker-compose build command, then everything is fine, the files are updated and the app is running. But I can't work like that and rerun this command every time I make a file change.

What I expect is a build refresh working without dropping an EACCESS error.

Additionnal informations about my project

This is a React project within Meteor framework in a container, using mongodb container within an nginx proxy in a container as well.

Project scaffold:

enter image description here

docker-compose file

enter image description here

docker file (.dev)

enter image description here

nb: as you can see, I create an user in the container, then I run the app into the container with this user. This is needed to ensure not running locally the app as root user.

WHAT I HAVE TRIED

  1. Delete the .meteor folder and rebuild locally with meteor run to ensure my current windows user has the rights for the meteor app build folder. It do not work.
  2. Remove the usage of meteoruser in the dockerfile, this does not work and instead drop an error, because meteor do not allow running app in a dev environment with root user, because it could lead to permission errors later in production..

Thanks in advance for your help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source