我們先假設我們已經把 Dockerfile 都設定好了也驗證過沒問題了
在 Cloud Build 之前~ Dockerfile 本地驗證
有些資訊要先準備 (我這邊都先亂填)
專案ID:**project-001**
伺服器地區:**asia-east1**
網站名稱: **web-name**
step1 打開 vscode 進到專案資料夾
step2 登入 gcloud
gcloud auth login
這時候會跳出瀏覽器驗證,驗證下去就對了
step3 設定專案位置
gcloud config set project **project-001**
gcloud config set run/region **asia-east1**
推送專案
gcloud builds submit --tag gcr.io/**project-001**/**web-name**
gcloud run deploy **web-name** --image gcr.io/**project-001**/**web-name** --allow-unauthenticated --set-env-vars=VITE_APP_API_PATH=https://api.tw
這個步驟會執行很久,但跑完也就OK了
留言