Docker Community Forums

Share and learn in the Docker community.

Bind-mount angular2 app into development container?

docker

(Jan Suchotzki) #1

I’m developing an Angular 2 application. From my current understanding it is the easiest way to just create source code on the host and have all required tools (typescript, angular-cli, …) running in a container. Now the problem is when I bind mount a host directory into the container most of the tools (especially angular-cli, but also tools like gulp from angular seed projects) are not properly working. Once I directly copy the source code into the container (with COPY during docker build) everything seems to work fine.

So the question is: Is my general approach correct and I “simply” need to find problems in my setup (e.g. problems with user permissions between host and container), or is there another way to quickly develop angular 2 applications inside a container. If bind-mount is not the way to go, I believe I need to rebuild my image every time I change source code. That seems to be impracticable.

Do you know any best practice on how to develop angular 2 applications with docker? So far I could not find too much information.


(Jan Suchotzki) #2

Problem solved. It wasn’t really clear to me how docker bind-mounts volumes from host into container. The great article Lessons from building a Node app in Docker provided me with the missing insides.