Angular CLI image for development purposes.
298
This is a minimal image with Node.js and Angular CLI for local development. It aims to fix two issues:
This image is very opinionated about the user and group ID. I made this for my teammates at Edosoft and at our workstations the user has UID=1001 and GUID=1001, so that is what I used. But you can rebuild the image using your UID and GUI.
Here you have the used Dockerfile:
Dockerfile.base
You can build your own image by running this command:
$ docker build . -f Dockerfile.base -t your_image_name
You can customize some options, like the UID and GUID, by passing them as --build-arg :
$ docker build --build-arg UID=1000 --build-arg GUID=1000 . -f Dockerfile.base -t your_image_name
This is useful if your normal user has another UID and GUID.
node:13.2.0-alpine13.2.08.2.148.3.20Create a docker-compose.yml like this one:
version: '3'
services:
ng:
image: juanje/angular-cli
container_name: angular-cli
volumes:
- '.:/app'
ports:
- '4200:4200'
npm:
image: juanje/angular-cli
container_name: npm
volumes:
- '.:/app'
entrypoint: 'npm'
test:
image: juanje/angular-cli-chrome
container_name: angular-cli-testing
volumes:
- '.:/app'
entrypoint: 'ng test --no-watch --no-progress'
Now you can run commands like these:
$ docker-compose run ng new projet_name
$ docker-compose run --service-ports ng serve --host=0.0.0.0
This will serve your project at http://localhost:4200/.
ng generate component mycomponent):$ docker-compose run ng generate module module_name
$ docker-compose run ng generate component component_name
$ docker-compose run ng generate component module_name/component_name
$ docker-compose run ng generate service service_name
$ docker-compose run ng build --prod
package.json:$ docker-compose run npm install
$ docker-compose run test
Content type
Image
Digest
Size
50.5 MB
Last updated
almost 7 years ago
docker pull juanje/angular-cli