Sunday 21 May 2017

docker-compose / nginx / SPA

I want to use docker-compose with two containers, a nginx and another one that have a node.js application. The node.js application is a Single Page Application and an API express server.

I want that nginx serves the static files from the SPA. The problem is that my app container compiles the SPA when it starts and then I do not have the files for the nginx container.

I do not want to create a data volume for it, as I want the "composed" environment to not depend on external state.

I think something on a transient volume (a volume that is started with docker-compose up) and then removed, but this feature seems to not exist.

Another way be to serve the static files by NFS in the app container and let nginx read them, but not sure about how good or bad would be this.

What's the best practice to run this environment?



via Adriano dos Santos Fernandes

No comments:

Post a Comment