https://github.com/ikmnjrd/react-ssr-knative-boilerplate
Cloud RunでReact SSRを試す
https://github.com/ikmnjrd/react-ssr-knative-boilerplate
Last synced: about 2 months ago
JSON representation
Cloud RunでReact SSRを試す
- Host: GitHub
- URL: https://github.com/ikmnjrd/react-ssr-knative-boilerplate
- Owner: ikmnjrd
- Created: 2021-12-12T06:34:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-12T14:03:48.000Z (over 3 years ago)
- Last Synced: 2025-01-19T14:18:29.647Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.25 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# セットアップ
## git clone
`# git clone [email protected]:ikmnjrd/react-ssr-knative-boilerplate.git``# rm -rf .git/`
`# npm install`
## Docker確認
`# docker build . -t {container_name}``# docker run -it --rm {container_name} bash`
# アプリをコンテナ化して Container Registry にアップロードする
## 適当にプロジェクトを作成
`# gcloud projects create プロジェクトID --name プロジェクト名`## Dockerfile を含むディレクトリから次のコマンドを実行し、Cloud Build を使用してコンテナ イメージをビルドします
`# gcloud builds submit --tag asia.gcr.io/PROJECT-ID/helloworld`## Cloud Run へのデプロイ
`# gcloud run deploy helloworld --image asia.gcr.io/PROJECT-ID/helloworld --region asia-northeast1 --platform managed --allow-unauthenticated`# 課題
Cloud runでのdeploy時、.gitignoreで指定されたファイル/ディレクトリだと、デプロイに失敗した。デプロイ時の `scripts: {"start": "node public/server.js"}` がパスの解決ができずエラーでデプロイ失敗する。