Sign inSign up

gilhardl/angular

By gilhardl

Updated about 7 years ago

Docker image for Angular development

Image
0

255

gilhardl/angular repository overview

docker-angular

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.

Docker Pulls


OS

ANGULAR CLI

NODE NPM YARN

PACKAGE MANAGER


Usage

With docker

Basic usage

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

Walkthrough
  1. Run Angular container to use Angular CLI
docker run -it --name angular -v /path/to/your/project:/usr/src/app -p 4200:4200 -p 49153:49153 gilhardl/angular
  1. Use Angular CLI

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

With docker-compose

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

Licence

MIT

Tag summary

Content type

Image

Digest

Size

374.1 MB

Last updated

about 7 years ago

docker pull gilhardl/angular