amrtgaber / angular-cli-docker-files

Files that will dockerize an angular-cli project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular Cli Docker Files

License: MIT

After generating a new project with the angular-cli (e.g. ng new myProject) these files can be used to dockerize the project.

Table of Contents

Instructions

ng new myProject

git clone git@github.com:amrtgaber/angular-cli-docker-files.git
cp angular-cli-docker-files/.dockerignore myProject/
cp angular-cli-docker-files/docker-compose.yml myProject/
cp angular-cli-docker-files/Dockerfile 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! 🎉

See it in action

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 myProject

Installing dependencies

npm install --save <dependency>
docker-compose down
docker-compose up --build

Add yourself as the maintainer

In the Dockerfile after the FROM line, add the line:

LABEL maintainer="Your name/organization <email or homepage>"

About

Files that will dockerize an angular-cli project.

License:MIT License