-
GCP app engine deployToday I Learned 2020. 2. 7. 15:07
문제
이번 프로젝트는 Amazon AWS가 아닌 GCP app engine을 이용해 deploy를 시도해보았다. gcloud SDK를 설치하고 command line 만을 이용해서 프로젝트를 생성하고 로컬 환경에 있는 프로젝트를 원격으로 deploy 할 수 있다.
해결
package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters{ "name": "youtube_ranking_api", ... "main": "app.js", "engines": { "node": ">=8.0.0" }, "scripts": { "start": "node app.js", "test": "echo \"Error: no test specified\" && exit 1" }, ... "dependencies": { "express": "^4.16.3", ... } app.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersruntime: nodejs env: flex manual_scaling: instances: 1 resources: cpu: 1 memory_gb: 0.5 disk_size_gb: 10 설치 및 방법
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characterscurl https://sdk.cloud.google.com | bash // sdk 다운로드 exec -l $SHELL // sdk 설치 gcloud init // gcloud cli initialize gcloud components update // updating gcloud projects create [PROJECT_ID] --set-as-default // create project gcloud app create --project=new-yr // create app gcloud app deploy // deploy 출처
https://cloud.google.com/appengine/docs/flexible/nodejs/runtime
Node.js 런타임 | Node.js 문서용 App Engine 가변형 환경 | Google Cloud
개요 Node.js 런타임은 애플리케이션의 코드 및 종속 항목을 설치하고 애플리케이션을 실행하는 소프트웨어 스택입니다. 이 런타임은 app.yaml에서 runtime: nodejs로 선언됩니다. runtime: nodejs env: flex 가변형 환경의 런타임은 Docker를 사용해 구축합니다. Node.js 런타임은 Ubuntu 16.04를 기반으로 하며 Node.js 런타임의 소스 코드는 GitHub에서 공개적으로 사용할 수 있습니다. 패키지 관리자
cloud.google.com
'Today I Learned' 카테고리의 다른 글
Markdown 문법 정리 (0) 2020.05.19 vi 자동으로 set nu 설정하기 (0) 2020.05.19 Youtube data API quota limit (0) 2020.02.05 Github issue의 중요성 (0) 2020.02.05 http vs https vs http2 (0) 2020.01.22