Skip to content

Commit 940a307

Browse files
committed
switch to using local images
1 parent 45cbc79 commit 940a307

4 files changed

Lines changed: 202 additions & 44 deletions

File tree

frontend/game.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
// ── Config ─────────────────────────────────────────────────────────────────
88
// const SERVER_URL = window.location.origin; // same origin as Flask
9-
const SERVER_URL = 'https://dc-deck-builder-35l4saorlq-uc.a.run.app"';
10-
const IMG_ROOT = '/card-images/';
9+
const SERVER_URL = 'https://dc-deck-builder-16370628759.us-central1.run.app';
10+
const IMG_ROOT = 'card-images/';
1111

1212
// ── Socket.IO ───────────────────────────────────────────────────────────────
1313
const socket = io(SERVER_URL, { transports: ['websocket', 'polling'] });

terraform/main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ resource "google_cloud_run_v2_service" "game" {
6666
client = "terraform"
6767
}
6868

69+
# ── Grant Cloud Run SA permission to pull from Artifact Registry ──────────────
70+
data "google_project" "project" {}
71+
72+
resource "google_artifact_registry_repository_iam_member" "cloud_run_reader" {
73+
project = var.project_id
74+
location = var.region
75+
repository = google_artifact_registry_repository.repo.repository_id
76+
role = "roles/artifactregistry.reader"
77+
member = "serviceAccount:${data.google_project.project.number}-compute@developer.gserviceaccount.com"
78+
}
79+
6980
# ── Allow unauthenticated public access ──────────────────────────────────────
7081
resource "google_cloud_run_v2_service_iam_member" "public" {
7182
project = var.project_id

terraform/terraform.tfstate

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 4,
33
"terraform_version": "1.14.6",
4-
"serial": 9,
4+
"serial": 11,
55
"lineage": "eca8a4ff-294d-64b8-d821-e3918df21dd5",
66
"outputs": {
77
"image_repo": {
@@ -14,6 +14,34 @@
1414
}
1515
},
1616
"resources": [
17+
{
18+
"mode": "data",
19+
"type": "google_project",
20+
"name": "project",
21+
"provider": "provider[\"registry.terraform.io/hashicorp/google\"]",
22+
"instances": [
23+
{
24+
"schema_version": 0,
25+
"attributes": {
26+
"auto_create_network": null,
27+
"billing_account": "018F15-891E5E-FD836E",
28+
"deletion_policy": "DELETE",
29+
"effective_labels": {},
30+
"folder_id": null,
31+
"id": "projects/website-489802",
32+
"labels": {},
33+
"name": "Website",
34+
"number": "16370628759",
35+
"org_id": null,
36+
"project_id": "website-489802",
37+
"skip_delete": null,
38+
"terraform_labels": {}
39+
},
40+
"sensitive_attributes": [],
41+
"identity_schema_version": 0
42+
}
43+
]
44+
},
1745
{
1846
"mode": "managed",
1947
"type": "google_artifact_registry_repository",
@@ -51,6 +79,34 @@
5179
}
5280
]
5381
},
82+
{
83+
"mode": "managed",
84+
"type": "google_artifact_registry_repository_iam_member",
85+
"name": "cloud_run_reader",
86+
"provider": "provider[\"registry.terraform.io/hashicorp/google\"]",
87+
"instances": [
88+
{
89+
"schema_version": 0,
90+
"attributes": {
91+
"condition": [],
92+
"etag": "BwZMyb0yJvY=",
93+
"id": "projects/website-489802/locations/us-central1/repositories/dc-deck-builder/roles/artifactregistry.reader/serviceAccount:16370628759-compute@developer.gserviceaccount.com",
94+
"location": "us-central1",
95+
"member": "serviceAccount:16370628759-compute@developer.gserviceaccount.com",
96+
"project": "website-489802",
97+
"repository": "projects/website-489802/locations/us-central1/repositories/dc-deck-builder",
98+
"role": "roles/artifactregistry.reader"
99+
},
100+
"sensitive_attributes": [],
101+
"identity_schema_version": 0,
102+
"private": "bnVsbA==",
103+
"dependencies": [
104+
"data.google_project.project",
105+
"google_artifact_registry_repository.repo"
106+
]
107+
}
108+
]
109+
},
54110
{
55111
"mode": "managed",
56112
"type": "google_cloud_run_v2_service",
@@ -60,7 +116,7 @@
60116
{
61117
"schema_version": 0,
62118
"attributes": {
63-
"annotations": null,
119+
"annotations": {},
64120
"binary_authorization": [],
65121
"client": "terraform",
66122
"client_version": "",
@@ -88,7 +144,7 @@
88144
],
89145
"create_time": "2026-03-12T00:57:32.108636Z",
90146
"creator": "elijahmad@gmail.com",
91-
"custom_audiences": null,
147+
"custom_audiences": [],
92148
"delete_time": "",
93149
"description": "",
94150
"effective_annotations": {},
@@ -98,7 +154,7 @@
98154
"generation": "1",
99155
"id": "projects/website-489802/locations/us-central1/services/dc-deck-builder",
100156
"ingress": "INGRESS_TRAFFIC_ALL",
101-
"labels": null,
157+
"labels": {},
102158
"last_modifier": "elijahmad@gmail.com",
103159
"latest_created_revision": "projects/website-489802/locations/us-central1/services/dc-deck-builder/revisions/dc-deck-builder-00001-7tq",
104160
"latest_ready_revision": "projects/website-489802/locations/us-central1/services/dc-deck-builder/revisions/dc-deck-builder-00001-7tq",
@@ -110,12 +166,12 @@
110166
"reconciling": false,
111167
"template": [
112168
{
113-
"annotations": null,
169+
"annotations": {},
114170
"containers": [
115171
{
116-
"args": null,
117-
"command": null,
118-
"depends_on": null,
172+
"args": [],
173+
"command": [],
174+
"depends_on": [],
119175
"env": [
120176
{
121177
"name": "USE_GEVENT",
@@ -163,7 +219,7 @@
163219
],
164220
"encryption_key": "",
165221
"execution_environment": "",
166-
"labels": null,
222+
"labels": {},
167223
"max_instance_request_concurrency": 80,
168224
"revision": "",
169225
"scaling": [

terraform/terraform.tfstate.backup

Lines changed: 124 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"version": 4,
33
"terraform_version": "1.14.6",
4-
"serial": 5,
4+
"serial": 9,
55
"lineage": "eca8a4ff-294d-64b8-d821-e3918df21dd5",
66
"outputs": {
77
"image_repo": {
88
"value": "us-central1-docker.pkg.dev/website-489802/dc-deck-builder/dc-deck-builder",
99
"type": "string"
10+
},
11+
"service_url": {
12+
"value": "https://dc-deck-builder-35l4saorlq-uc.a.run.app",
13+
"type": "string"
1014
}
1115
},
1216
"resources": [
@@ -38,7 +42,7 @@
3842
"repository_id": "dc-deck-builder",
3943
"terraform_labels": {},
4044
"timeouts": null,
41-
"update_time": "2026-03-11T04:41:09.350964Z",
45+
"update_time": "2026-03-12T00:53:25.129293Z",
4246
"virtual_repository_config": []
4347
},
4448
"sensitive_attributes": [],
@@ -54,36 +58,56 @@
5458
"provider": "provider[\"registry.terraform.io/hashicorp/google\"]",
5559
"instances": [
5660
{
57-
"status": "tainted",
5861
"schema_version": 0,
5962
"attributes": {
6063
"annotations": null,
6164
"binary_authorization": [],
6265
"client": "terraform",
63-
"client_version": null,
64-
"conditions": null,
65-
"create_time": null,
66-
"creator": null,
66+
"client_version": "",
67+
"conditions": [
68+
{
69+
"execution_reason": "",
70+
"last_transition_time": "2026-03-12T00:57:39.078551Z",
71+
"message": "",
72+
"reason": "",
73+
"revision_reason": "",
74+
"severity": "",
75+
"state": "CONDITION_SUCCEEDED",
76+
"type": "RoutesReady"
77+
},
78+
{
79+
"execution_reason": "",
80+
"last_transition_time": "2026-03-12T00:57:33.136404Z",
81+
"message": "",
82+
"reason": "",
83+
"revision_reason": "",
84+
"severity": "",
85+
"state": "CONDITION_SUCCEEDED",
86+
"type": "ConfigurationsReady"
87+
}
88+
],
89+
"create_time": "2026-03-12T00:57:32.108636Z",
90+
"creator": "elijahmad@gmail.com",
6791
"custom_audiences": null,
68-
"delete_time": null,
69-
"description": null,
70-
"effective_annotations": null,
71-
"effective_labels": null,
72-
"etag": null,
73-
"expire_time": null,
74-
"generation": null,
92+
"delete_time": "",
93+
"description": "",
94+
"effective_annotations": {},
95+
"effective_labels": {},
96+
"etag": "\"CPyeyM0GEODO5jM/cHJvamVjdHMvd2Vic2l0ZS00ODk4MDIvbG9jYXRpb25zL3VzLWNlbnRyYWwxL3NlcnZpY2VzL2RjLWRlY2stYnVpbGRlcg\"",
97+
"expire_time": "",
98+
"generation": "1",
7599
"id": "projects/website-489802/locations/us-central1/services/dc-deck-builder",
76-
"ingress": null,
100+
"ingress": "INGRESS_TRAFFIC_ALL",
77101
"labels": null,
78-
"last_modifier": null,
79-
"latest_created_revision": null,
80-
"latest_ready_revision": null,
81-
"launch_stage": null,
102+
"last_modifier": "elijahmad@gmail.com",
103+
"latest_created_revision": "projects/website-489802/locations/us-central1/services/dc-deck-builder/revisions/dc-deck-builder-00001-7tq",
104+
"latest_ready_revision": "projects/website-489802/locations/us-central1/services/dc-deck-builder/revisions/dc-deck-builder-00001-7tq",
105+
"launch_stage": "GA",
82106
"location": "us-central1",
83107
"name": "dc-deck-builder",
84-
"observed_generation": null,
108+
"observed_generation": "1",
85109
"project": "website-489802",
86-
"reconciling": null,
110+
"reconciling": false,
87111
"template": [
88112
{
89113
"annotations": null,
@@ -105,7 +129,7 @@
105129
"ports": [
106130
{
107131
"container_port": 8080,
108-
"name": ""
132+
"name": "http1"
109133
}
110134
],
111135
"resources": [
@@ -118,43 +142,110 @@
118142
"startup_cpu_boost": false
119143
}
120144
],
121-
"startup_probe": [],
145+
"startup_probe": [
146+
{
147+
"failure_threshold": 1,
148+
"grpc": [],
149+
"http_get": [],
150+
"initial_delay_seconds": 0,
151+
"period_seconds": 240,
152+
"tcp_socket": [
153+
{
154+
"port": 8080
155+
}
156+
],
157+
"timeout_seconds": 240
158+
}
159+
],
122160
"volume_mounts": [],
123161
"working_dir": ""
124162
}
125163
],
126164
"encryption_key": "",
127165
"execution_environment": "",
128166
"labels": null,
129-
"max_instance_request_concurrency": 0,
167+
"max_instance_request_concurrency": 80,
130168
"revision": "",
131169
"scaling": [
132170
{
133171
"max_instance_count": 1,
134172
"min_instance_count": 0
135173
}
136174
],
137-
"service_account": "",
175+
"service_account": "16370628759-compute@developer.gserviceaccount.com",
138176
"session_affinity": false,
139-
"timeout": "1800s",
177+
"timeout": "3600s",
140178
"volumes": [],
141179
"vpc_access": []
142180
}
143181
],
144-
"terminal_condition": null,
145-
"terraform_labels": null,
182+
"terminal_condition": [
183+
{
184+
"execution_reason": "",
185+
"last_transition_time": "2026-03-12T00:57:39.110913Z",
186+
"message": "",
187+
"reason": "",
188+
"revision_reason": "",
189+
"severity": "",
190+
"state": "CONDITION_SUCCEEDED",
191+
"type": "Ready"
192+
}
193+
],
194+
"terraform_labels": {},
146195
"timeouts": null,
147-
"traffic": null,
148-
"traffic_statuses": null,
149-
"uid": null,
150-
"update_time": null,
151-
"uri": null
196+
"traffic": [
197+
{
198+
"percent": 100,
199+
"revision": "",
200+
"tag": "",
201+
"type": "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"
202+
}
203+
],
204+
"traffic_statuses": [
205+
{
206+
"percent": 100,
207+
"revision": "",
208+
"tag": "",
209+
"type": "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST",
210+
"uri": ""
211+
}
212+
],
213+
"uid": "5351856f-e4b1-4954-b2f0-c6b3693a9d7d",
214+
"update_time": "2026-03-12T00:57:32.108636Z",
215+
"uri": "https://dc-deck-builder-35l4saorlq-uc.a.run.app"
152216
},
153217
"sensitive_attributes": [],
154218
"identity_schema_version": 0,
155219
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19"
156220
}
157221
]
222+
},
223+
{
224+
"mode": "managed",
225+
"type": "google_cloud_run_v2_service_iam_member",
226+
"name": "public",
227+
"provider": "provider[\"registry.terraform.io/hashicorp/google\"]",
228+
"instances": [
229+
{
230+
"schema_version": 0,
231+
"attributes": {
232+
"condition": [],
233+
"etag": "BwZMyT1zPDg=",
234+
"id": "projects/website-489802/locations/us-central1/services/dc-deck-builder/roles/run.invoker/allUsers",
235+
"location": "us-central1",
236+
"member": "allUsers",
237+
"name": "projects/website-489802/locations/us-central1/services/dc-deck-builder",
238+
"project": "website-489802",
239+
"role": "roles/run.invoker"
240+
},
241+
"sensitive_attributes": [],
242+
"identity_schema_version": 0,
243+
"private": "bnVsbA==",
244+
"dependencies": [
245+
"google_cloud_run_v2_service.game"
246+
]
247+
}
248+
]
158249
}
159250
],
160251
"check_results": null

0 commit comments

Comments
 (0)