Home

Awesome

ngx-deploy-docker 🚀🐳

This Project is still work in progress.

CI Pipeline NPM version The MIT License

Dockerize your Angular application with ease and deploy your image right from the Angular CLI to a registry 🚀

Table of contents:

  1. 📖 Changelog
  2. 🚀 Quick Start (local development)
  3. 🚀 Continuous Delivery
  4. 📦 Options
  5. 📁 Configuration File
  6. 🏁 Next milestones
<hr>

📖 Changelog <a name="changelog"></a>

A detailed changelog is available here.

🚀 Quick Start (local development) <a name="quickstart-local"></a>

This quick start assumes that you are starting from scratch. If you already have an existing Angular project, skip step 1.

  1. Install the latest version of the Angular CLI (v13.0.0 or greater) globally and create a new Angular project. Make sure you have a suitable version of nodeJs installed.

    npm install -g @angular/cli
    ng new your-angular-project --defaults
    cd your-angular-project
    
  2. Add ngx-deploy-docker to your project.

    ng add ngx-deploy-docker
    
  3. Make sure, Docker works properly on your client and you are authenticated at the repository of your choice.

    docker login
    
  4. Deploy your newly built image to the registry with all default settings. Your project will be automatically built in production mode.

    ng deploy
    

    Which is the same as:

    ng deploy your-angular-project
    

🚀 Continuous Delivery <a name="continuous-delivery"></a>

...more to come

📦 Options <a name="options"></a>

--base-href <a name="base-href"></a>

Specifies the base URL for the application being built. Same as ng build --base-href=/XXX/

--build-target <a name="build-target"></a>

A named build target, as specified in the configurations section of angular.json. Each named target is accompanied by a configuration of option defaults for that target. Same as ng run <app>. This command has no effect if the option --no-build option is active.

--no-build <a name="no-build"></a>

Skip build process during deployment. This can be used when you are sure that you haven't changed anything and want to deploy with the latest artifact. This command causes the --build-target setting to have no effect.

--image-name <a name="image-name"></a>

--account <a name="account"></a>

This option may be necessary, depending on your write-rights within the repository, you want to push to.

--tag <a name="tag"></a>

📁 Configuration File <a name="configuration-file"></a>

To avoid all these command-line cmd options, you can write down your configuration in the angular.json file in the options attribute of your deploy project's architect. Just change the kebab-case to lower camel case. This is the notation of all options in lower camel case:

A list of all available options is also available here.

Example:

ng deploy --build-target=<app>:build:production --tag=next

becomes

"deploy": {
  "builder": "ngx-deploy-docker:deploy",
  "options": {
    "buildTarget": "<app>:build:production",
    "tag": "next"
  }
}

And just run ng deploy 😄.

🏁 Next milestones <a name="milestones"></a>

We look forward to any help. PRs are welcome! 😃

License

Code released under the MIT license.

<hr>

Attribution

🚀 Powered By ngx-deploy-starter

🔥 Many things have been taken over from transloco