AngularJS on nginx in Docker container AngularJS on nginx in Docker container nginx nginx

AngularJS on nginx in Docker container


You are obviously using node as your dev server and want to use NGINX as your prod server? We have a similar setup

this is how we do it ...

in our dev environment, we have /dist on .gitignore

on a push to git we have a Jenkins job that does a build (this does the npm install inside a Jenkins build server)

on a successful Jenkins job we do a docker build (a downstream job), the docker build copies the /dist files into the docker image

we then do a docker push

the resulting docker image can be pulled from any server - hope that helps

would welcome your thoughts :)

PS The problem with doing the npm install during the docker build is that your docker container becomes messy. You end up installing loads of software inside it just for setup purposes.

All you really want in your docker image is NGINX serving up your build files.

This is why we do not do an npm install during the docker build.