Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

6.3.6. Node.js

  1. 새 GitHub 리포지토리를 설정하고 현재 로컬 Git 리포지토리에 원격 분기로 추가합니다.

    $ git remote add <remote-name> https://github.com/<github-id>/<repo-name>
  2. 로컬 v2 소스 코드를 새 리포지토리로 내보냅니다.

    $ git push -u <remote-name> master
  3. 로컬 Git 리포지토리를 편집하고 변경 사항을 업스트림으로 내보내 v3와 호환되도록 합니다.

    1. .openshift 디렉터리를 제거합니다.

      참고

      v3에서는 action_hookscron 작업이 동일한 방식으로 지원되지 않습니다. 자세한 내용은 Action Hooks for more information를 참조하십시오.

    2. server.js 를 편집합니다.

      • L116 server.js: 'self.app = express();'
      • L25 server.js: self.ipaddress = '0.0.0.0';
      • L26 server.js: self.port = 8080;

        참고

        라인(L)은 기본 V2 타겟 서버.js .js 에서 가져온 것입니다.

  4. oc 명령을 사용하여 빌더 이미지 및 소스 코드에서 새 Node.js 애플리케이션을 시작합니다.

    $ oc new-app https://github.com/<github-id>/<repo-name>.git
    --name=<app-name> -e <ENV_VAR_NAME>=<env_var_value>

지원되는 Node.js 버전

v2v3

Node.js 0.10

지원되는 컨테이너 이미지

 

nodejs-mongodb-example. 이 빠른 시작 템플릿은 Node.js 버전 6만 지원합니다.