-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudbuild.yaml
32 lines (29 loc) · 1.13 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
steps:
# Build the Docker image
- name: "gcr.io/cloud-builders/docker"
args:
- "build"
- "-t"
- "gcr.io/$PROJECT_ID/flask-app:$COMMIT_SHA"
- "."
# Push the Docker image to Google Container Registry (GCR)
- name: "gcr.io/cloud-builders/docker"
args:
- "push"
- "gcr.io/$PROJECT_ID/flask-app:$COMMIT_SHA"
# Deploy the Docker image to Cloud Run
- name: "gcr.io/cloud-builders/gcloud"
args:
- "run"
- "deploy"
- "flask-app"
- "--image=gcr.io/$PROJECT_ID/flask-app:$COMMIT_SHA"
- "--platform=managed"
- "--region=YOUR_REGION" # Replace with your desired region
- "--allow-unauthenticated" # Allow unauthenticated access if needed
- "--port=8080" # Specify the port your application listens on
- "--cpu=1" # Specify CPU allocation (adjust as needed)
- "--memory=512Mi" # Specify memory allocation (adjust as needed)
- "--timeout=300" # Set the maximum request timeout (adjust as needed)
images:
- "gcr.io/$PROJECT_ID/flask-app:$COMMIT_SHA"