Giter Site home page Giter Site logo

evanshortiss / openshift-typescript-example Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 7.0 48 KB

A sample TypeScript application that can be deployed on OpenShift

TypeScript 69.26% Dockerfile 0.98% Shell 12.45% Handlebars 17.31%
openshift typescript ts kubernetes nodejs javascript openshift-origin openshift-io okd

openshift-typescript-example's Introduction

TypeScript Sample Application

This repository provides a simple starting point for running TypeScript applications on OpenShift. It can also be applied to applications that use Babel or other transpilers.

A blogpost that runs through the details of this repository and OpenShift can be found here.

You can use this repository as a template, just click the green "Use this template" button at the top of this page on GitHub.

Running on OpenShift via NodeShift

To use this method of deployment you'll need:

NodeShift is a neat CLI that simplifies deployment of Node.js applications on OpenShift. This project incldues NodeShift in devDependencies.

You can run the following to deploy it on an OpenShift instance:

$ git clone [email protected]:evanshortiss/openshift-typescript-example.git ts-openshift

$ cd ts-openshift

# Ensure you are logged into your openshift instance
$ oc login

# Choose the project you'd like to deploy this applicaion into
$ oc new-project ts-example

# Build, deploy, and expose an endpoint for the service
$ npm run nodeshift -- --expose

If you're deploying on a locally running instance of OpenShift you might need to do the following to bypass the self-signed certificate issues:

$ npm run nodeshift -- --expose --strictSSL=false

Run Locally without Docker

To run this application locally you'll need:

  • Node.js v12 or later
  • npm v6 or later
  • Git

Execute the following commands to start the program locally:

git clone [email protected]:evanshortiss/openshift-typescript-example.git ts-openshift

cd ts-openshift

npm instal
npm run build
npm start

If you're developing locally, start a live reload server like so:

npm run start-dev

Build Locally using Source-to-Image (s2i)

To perform the following steps you'll need:

With both tools installed, execute the following commands to run your application locally. This will create a container that matches the one created using an OpenShift Build.

# Run the s2i build script
./scripts/s2i.sh

# Run the container image
docker run -p 8080:8080 quay.io/evanshortiss/openshift-s2i-typescript-example

Running Local Dev Mode using Docker Compose

To perform the following steps you'll need:

Run the docker-compose up command from the root of the repository to start Node.js and Redis containers.

The application will be available on port 8080.

openshift-typescript-example's People

Contributors

evanshortiss avatar utherp0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.