Git Product home page Git Product logo

s2i-angular-httpd24's Introduction

S2I Builder for Angular Apps

This repository contains the source for building Angular applications based on the official httpd24 CentOS and Red Hat images using source-to-image (S2I).

For more information about using these images with OpenShift, please see the official OpenShift documentation.

Configuration

The following configuration environment variables are specific to this image:

  • NG_CONFIG - the Angular configuration to pass to ng build. This defaults to production.
  • NODE_ENV - this defaults to production.
  • NPM_CONFIG_LOGLEVEL - this defaults to info.
  • NPM_MIRROR - an NPM registry mirror to use instead of the official NPM registry. Please note that if the mirror uses a certificate signed by an untrusted CA, you'll need to mount the certificate of the untrusted CA in the build container, and use the npm_config_cafile environment variable to point to the mounted CA certificate.

All other environment variables from the base image can also be overriden.

Additionally, you can mount Angular environment files in /tmp/ng-environments/ and they will be copied to ./src/environments/. This is useful if you'd like to override the environment files stored in source.

Installation

To build an Angular Docker image, choose either the CentOS or RHEL based image.

CentOS Based Image

This image is available on DockerHub. To download it, run:

$ sudo docker pull docker pull mprahl/s2i-angular-httpd24

To build your Angular app image with S2I, run:

$ sudo s2i build <git_url> mprahl/s2i-angular-httpd24 <app_image_name>

RHEL Based Image

This image is not on any public registries, so you must build it from scratch. To build it, run:

$ sudo docker build -t mprahl/s2i-angular-httpd24-rhel7 https://raw.githubusercontent.com/mprahl/s2i-angular-httpd24/master/Dockerfile.rhel7

To build your Angular app image with S2I, run:

$ sudo s2i build <git_url> mprahl/s2i-angular-httpd24-rhel7 <app_image_name>

Testing

This repository contains an Angular demo app produced from ng new test-app --minimal in the directory test/test-app. This can be used for testing purposes. To build a Docker image with this demo app, run:

$ sudo s2i build https://github.com/mprahl/s2i-angular-httpd24 \
    --context-dir=test/test-app/ mprahl/s2i-angular-httpd24 angular-demo-app
$ sudo docker run -p 8080:8080 angular-demo-app

You can also run the test script with the following:

$ sudo docker build -t angular-httpd24-candidate .
$ sudo IMAGE_NAME=angular-httpd24-candidate test/run

OpenShift

To use the S2I image within OpenShift, you must create an image stream in your project. To do this, run:

$ oc create -f s2i-angular-httpd24.yml

Alternatively, if you'd prefer to have the OpenShift image stream available globally, you can create the image stream in the openshift namespace. To do this, run:

$ oc create -f s2i-angular-httpd24.yml -n openshift

To view the newly created image stream, run:

$ oc describe imagestream s2i-angular-httpd24

The builder image will now appear as "Angular" under the category "JavaScript" in the OpenShift UI.

s2i-angular-httpd24's People

Contributors

enilpajic avatar mprahl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.