I am trying for local development to use ember in a container. The problem is that I will go and save a file and ember in the container crashes. Its just so frustrating and not sure if this is an ember or a docker issue. Here is what is in the log file
ERROR Summary:
- broccoliBuilderErrorStack: Error: ENOENT: no such file or directory, scandir '/myapp/tmp/config_loader-input_base_path-bwCbaFQr.tmp/'
at Object.fs.readdirSync (fs.js:904:18)
at _walkSync (/myapp/node_modules/walk-sync/index.js:74:18)
at Function.entries (/myapp/node_modules/walk-sync/index.js:50:10)
at ConfigLoader.CachingWriter._conditionalBuild (/myapp/node_modules/broccoli-caching-writer/index.js:112:24)
at /myapp/node_modules/broccoli-plugin/read_compat.js:93:34
at tryCatch (/myapp/node_modules/rsvp/dist/rsvp.js:525:12)
at invokeCallback (/myapp/node_modules/rsvp/dist/rsvp.js:538:13)
at publish (/myapp/node_modules/rsvp/dist/rsvp.js:508:7)
at flush (/myapp/node_modules/rsvp/dist/rsvp.js:2415:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
- codeFrame: ENOENT: no such file or directory, scandir '/myapp/tmp/config_loader-input_base_path-bwCbaFQr.tmp/'
- errorMessage: Build Canceled: Broccoli Builder ran into an error with `ConfigLoader` plugin. 💥
ENOENT: no such file or directory, scandir '/myapp/tmp/config_loader-input_base_path-bwCbaFQr.tmp/'
- errorType: Build Error
- location:
- column: [undefined]
- file: [undefined]
- line: [undefined]
- treeDir: [undefined]
- message: Build Canceled: Broccoli Builder ran into an error with `ConfigLoader` plugin. 💥
ENOENT: no such file or directory, scandir '/myapp/tmp/config_loader-input_base_path-bwCbaFQr.tmp/'
- name: Error
- nodeAnnotation: ConfigLoader
- nodeName: ConfigLoader
- originalErrorMessage: ENOENT: no such file or directory, scandir '/myapp/tmp/config_loader-input_base_path-bwCbaFQr.tmp/'
- stack: Error: ENOENT: no such file or directory, scandir '/myapp/tmp/config_loader-input_base_path-bwCbaFQr.tmp/'
at Object.fs.readdirSync (fs.js:904:18)
at _walkSync (/myapp/node_modules/walk-sync/index.js:74:18)
at Function.entries (/myapp/node_modules/walk-sync/index.js:50:10)
at ConfigLoader.CachingWriter._conditionalBuild (/myapp/node_modules/broccoli-caching-writer/index.js:112:24)
at /myapp/node_modules/broccoli-plugin/read_compat.js:93:34
at tryCatch (/myapp/node_modules/rsvp/dist/rsvp.js:525:12)
at invokeCallback (/myapp/node_modules/rsvp/dist/rsvp.js:538:13)
at publish (/myapp/node_modules/rsvp/dist/rsvp.js:508:7)
at flush (/myapp/node_modules/rsvp/dist/rsvp.js:2415:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
I have been using Docker with Ember for a long time now and it works great for the most part.
The thing that might be causing problems with your setup is that you are sharing the tmp folder using volumes.
I would remove bower_components, node_modules and tmp folders from the volumes section of your docker-compose.yml.
One of the reason why you wouldn’t want to share node_modules for example, is that it might be using native extensions. These native extensions usually needs to be build on the platform that will be running on. One project that has native extensions is node-sass which is a dependency of ember-cli-sass.
You will notice that in - /myapp/bower_components that its not following the convention of x:x. This is a way in docker-compose to exclude it. I guess maybe I do not need that since I added those directories to the dockerignore?
I did until I realized that docker was keeping the node_modules, tmp, and bower_components in sync between host and container. After disabling that, things will speed up alot. I have noticed if you have a big project it can get slow as well
I feel that is a little slower than when outside of Docker. However, it can depend how are you using Docker, eg. Docker for mac, filesystem etc.
I have been using Ember with docker for a long time now, for sure I had moment that I wanted to stop using Docker, mainly it was before Docker for Mac and the nice filesystem integration. Now days it works very well, however, if you have a bunch of projects running in docker and not much memory, the Ember build can get very slow as well.
In my experience I was doing a fair bit of development on a Windows 10 machine (Surface Book 2 with great specs) and npm install and live reload and ember build are all very very slow. When I use docker for local ember-cli development it actually becomes much faster. I believe this is because the filesystem read/write is slow in Windows and fast in Linux.