After generating a new project with the angular-cli (e.g. ng new myProject
) these files can be used to dockerize the project.
ng new myProject
git clone [email protected]:amrtgaber/angular2-cli-docker-files.git
cp angular2-cli-docker-files/* angular2-cli-docker-files/.* myProject/
cd myProject
# Replaces 'APP-NAME-HERE' in the Dockerfile and docker-compose.yml
sed -i 's/APP-NAME-HERE/myProject/g' *
docker-compose up
That's it! ๐ โจ โจ
Navigate to localhost:4200
in your browser.
NOTE: For docker toolbox you must replace 'localhost' with the machine ip. You can get the machine ip with the following command.
docker-machine ip angular2-cli-webpack-docker
npm install --save <dependency>
docker-compose down
docker-compose up --build