Docker image for Angular development, based on gilhardl/node
Built to help building Angular app on Windows with Docker Desktop to get a fully working Linux development environnement.
Start CLI :
docker run -it --name angular -v /path/to/your/project:/usr/src/app gilhardl/angular
Start CLI and expose ports to be able to serve the app :
docker run -it --name angular -v /path/to/your/project:/usr/src/app -p 4200:4200 -p 49153:49153 gilhardl/angular
Serving your app :
In order to get livereload working, you'll need to define the file watching poll time to 1ms :
ng serve --host=0.0.0.0 --poll 1
You also need to specify 0.0.0.0 to get access from your host browser
docker run -it --name angular -v /path/to/your/project:/usr/src/app -p 4200:4200 -p 49153:49153 gilhardl/angular
Create a project :
ng new yourapp
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS
...
Serve your app :
ng serve --host=0.0.0.0 --poll 1
Create a file named docker-compose.yml at your project root like the following :
version: '3'
services:
app:
container_name: yourapp-app
build: .
image: gilhardl/angular
ports:
- 4200:4200
- 49153:49153
volumes:
- .:/usr/src/app/
command: ng serve --host=0.0.0.0 --poll 1
restart: always
Serve your app :
docker-compose up
MIT
Content type
Image
Digest
Size
374.1 MB
Last updated
about 7 years ago
docker pull gilhardl/angular