{"id":17668588,"url":"https://github.com/evanshortiss/s2i-nodejs-nginx-example","last_synced_at":"2026-02-02T05:34:05.202Z","repository":{"id":37792821,"uuid":"279687819","full_name":"evanshortiss/s2i-nodejs-nginx-example","owner":"evanshortiss","description":"An example webapp that can be deployed on OpenShift using the s2i-nodejs-nginx builder","archived":false,"fork":false,"pushed_at":"2023-01-07T00:10:48.000Z","size":1143,"stargazers_count":1,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T05:49:35.033Z","etag":null,"topics":["nginx-container","openshift","react","s2i","s2i-nodejs","source-to-image","typescript","webapp","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evanshortiss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-14T20:36:05.000Z","updated_at":"2023-03-05T07:22:18.000Z","dependencies_parsed_at":"2023-02-06T10:01:51.928Z","dependency_job_id":null,"html_url":"https://github.com/evanshortiss/s2i-nodejs-nginx-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/evanshortiss/s2i-nodejs-nginx-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fs2i-nodejs-nginx-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fs2i-nodejs-nginx-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fs2i-nodejs-nginx-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fs2i-nodejs-nginx-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evanshortiss","download_url":"https://codeload.github.com/evanshortiss/s2i-nodejs-nginx-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fs2i-nodejs-nginx-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260962640,"owners_count":23089455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nginx-container","openshift","react","s2i","s2i-nodejs","source-to-image","typescript","webapp","webpack"],"created_at":"2024-10-23T23:23:09.923Z","updated_at":"2026-02-02T05:34:00.182Z","avatar_url":"https://github.com/evanshortiss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example Application for Source-to-Image Node.js \u0026 NGINX Builds\n\nAn example static web application that contains scripts to simplify deployment\non OpenShift as an NGINX container.\n\nThis application uses the following libraries/tools, but you can replace them\nwith your preferred stack:\n\n* React\n* Tailwind CSS\n* TypeScript\n* Webpack\n* npm\n\n## Build \u0026 Run Locally\n\nFirst install dependencies:\n\n```bash\n# install dependencies\nnpm install\n\n# run in hot module reloading mode\nnpm start\n```\n\n## Create a Production Bundle\n\nThis will generate a bundle of production optimised static assets in a *dist/*\ndirectory in the project folder:\n\n```bash\nnpm run build\n```\n\n## Create a Development Bundle\n\nThis will generate a bundle of static assets in a *dist/* directory in the\nproject folder:\n\n```bash\nnpm run build:dev\n```\n\n## Create a Deployable NGINX Container Image\n\nEach of the options below relies on the `npm build` (alias for `npm run build`)\ncommand to create a *dist/* folder in the root of your project that contains\nall the static assets for the application, i.e HTML, CSS, JavaScript, and\nbinary files.\n\nThis folder can safely (and probably shouldbe !) added to the *gitignore* since\neach build option will generate it using `npm build`.\n\n### Using Chained s2i Builds on OpenShift\n\nUses [source-to-image (s2i)](https://github.com/openshift/source-to-image) on\nan OpenShift cluster to chain two builds. Requires the [OpenShift CLI](https://docs.openshift.com/container-platform/4.5/cli_reference/openshift_cli/getting-started-cli.html).\n\nThe first build uses a Node.js builder image to prepare the static assets\nusing Webpack. The second build uses an NGINX builder image to take the static\nassets from the first Node.js build and produce a deployable NGINX container\nimage.\n\n```bash\nexport GIT_REPO=https://github.com/evanshortiss/s2i-nodejs-nginx-example\n\n# Create a Node.js build to run Webpack and store the results\n# in a Node.js container image. This image won't be deployed\noc new-build nodejs~$GIT_REPO --name webapp-npm-build\n\n# After the first build is finished and stored in\n# the OpenShift registry pass it to an NGINX build\noc new-build --name=webapp-nginx-runtime \\\n--docker-image=centos/nginx-116-centos7 \\\n--source-image=webapp-npm-build \\\n--source-image-path=\"/opt/app-root/src/dist/.:.\" \\\n--strategy=source\n\n# Create a Deployment the new nginx container\noc new-app webapp-nginx-runtime\n\n# Optional label/annotations to show an NGINX\n# icon on the topology view in the OpenShift UI\noc annotate dc/webapp-nginx-runtime app.openshift.io/runtime=nginx\noc label dc/webapp-nginx-runtime app.openshift.io/runtime=nginx\n```\n\nThe second build (webapp-nginx-runtime) will start anytime the first build\n(webapp-npm-build) finishes. Run `oc start-build webapp-nginx-runtime` to\ntrigger a new build, or setup your own [Build Triggers](https://docs.openshift.com/container-platform/4.5/builds/triggering-builds-build-hooks.html).\n\n### Using a Custom s2i Build Image on OpenShift\n\nUses [source-to-image (s2i)](https://github.com/openshift/source-to-image)\nto perform a single build. Requires the [OpenShift CLI](https://docs.openshift.com/container-platform/4.5/cli_reference/openshift_cli/getting-started-cli.html).\n\n```bash\nexport GIT_REPO=https://github.com/evanshortiss/s2i-nodejs-nginx-example\nexport BUILDER_IMAGE=quay.io/evanshortiss/s2i-nodejs-nginx\n\n# Build and deploy the application using the s2i-nodejs-nginx builder\noc new-app $BUILDER_IMAGE~$GIT_REPO --name webapp-npm-build\n```\n\n### Using a Local s2i Build\n\nUses [source-to-image (s2i)](https://github.com/openshift/source-to-image) to\ncreate an NGINX container image that serves the application assets.\n\nYou need to\n[install s2i](https://github.com/openshift/source-to-image#installation) and\n[Docker](https://docs.docker.com/get-docker/) before running the commands\nbelow to generate a container image.\n\nOnce s2i is installed, create a build with the following command:\n\n```bash\n# use the s2i-nodejs-nginx image with Node.js 14 to build this application\n# into a deployable NGINX 1.18 container image named \"my-web-app\"\ns2i build -c . quay.io/evanshortiss/s2i-nodejs-nginx:14-nginx1.18 my-web-app\n```\n\nAlternatively use this shorthand command:\n\n```bash\nnpm run docker:build\n```\n\nAnd run it locally using Docker or Podman:\n\n```bash\ndocker run -p 8080:8080 my-web-app\n```\n\n## Credits\n\n* Initial project structure was generated using [createapp.dev](https://createapp.dev/)\n* Star Wars icons created by Symbolicons. The icon set can be found [here](https://www.iconfinder.com/search/?q=designer%3Asensibleworld%20star%20wars\u0026from=profile%20preview).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanshortiss%2Fs2i-nodejs-nginx-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanshortiss%2Fs2i-nodejs-nginx-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanshortiss%2Fs2i-nodejs-nginx-example/lists"}