A Docker image for angular applications. Already comes with default dependencies installed...
You just need to mount the /PATH/TO/APP to the conatiners /usr/src/app, such as:
docker run --rm -it -v /PATH/TO/APP:/usr/src/app -p 4200:4200 binfalse/angular-cli
This will execute npm install && npm start in your project.
Thus, your npm will install everything, if that is the first run.
Afterwards it will serve you app.
Depending on your configuration you may now see your app running at http://localhost:4200 on your host :)
To compile everything, you just need to add the compile command to the end of above's command line. Let's say you would compile it through
ng build --prod --bh / -d /
Then you would to run:
docker run --rm -it -v /PATH/TO/APP:/usr/src/app binfalse/angular-cli ng build --prod --bh / -d /
This will compile a release into the dist/ of /PATH/TO/APP, so you may just run an nginx to serve the files:
docker run --rm -it -p 8080:80 -v /PATH/TO/APP/dist:/usr/share/nginx/html:ro nginx
This time, your app will be available at http://localhost:8080 -- go and check!
That's it... :)
Content type
Image
Digest
Size
371 MB
Last updated
almost 6 years ago
docker pull lra73/angular-cli