Skip to content

Commit 856164d

Browse files
authored
ci(general): updates gateway/voices deployments (#2176)
1 parent c437b00 commit 856164d

File tree

3 files changed

+76
-10
lines changed

3 files changed

+76
-10
lines changed

catalyst-gateway/blueprint.cue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ project: {
1111
merge: {}
1212
tag: {}
1313
}
14+
1415
bundle: {
1516
modules: main: {
1617
name: "app"
@@ -185,13 +186,10 @@ project: {
185186
}
186187
}
187188

188-
ingress: {
189-
health: {
190-
path: "/api/v1/health/live"
191-
successCodes: "204"
192-
}
193-
subdomain: "gateway"
194-
}
189+
dns: subdomain: "gateway"
190+
route: rules: [{
191+
matchPrefix: "/"
192+
}]
195193

196194
secrets: {
197195
db: {
@@ -222,6 +220,7 @@ project: {
222220
}
223221
}
224222
}
223+
225224
release: {
226225
docker: {
227226
on: {

catalyst_voices/Earthfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ package:
129129
ARG tag='latest'
130130

131131
COPY +build-web/web /app
132+
133+
# Note this is only used for local development, a different nginx.conf is
134+
# used during deployment. See blueprint.cue.
132135
COPY ./nginx.conf /etc/nginx/nginx.conf
136+
133137
EXPOSE 80
134138

135139
SAVE IMAGE voices-frontend:$tag

catalyst_voices/blueprint.cue

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ project: {
66
merge: {}
77
tag: {}
88
}
9+
910
bundle: {
1011
modules: main: {
1112
name: "app"
@@ -16,21 +17,83 @@ project: {
1617
name: _ @forge(name="CONTAINER_IMAGE")
1718
tag: _ @forge(name="GIT_HASH_OR_TAG")
1819
}
19-
port: 80
20+
mounts: {
21+
config: {
22+
ref: {
23+
config: {
24+
name: "nginx"
25+
}
26+
}
27+
path: "/etc/nginx/nginx.conf"
28+
subPath: "nginx.conf"
29+
}
30+
}
31+
port: 8080
2032
probes: {
2133
liveness: path: "/"
2234
readiness: path: "/"
2335
}
2436
}
25-
ingress: subdomain: "voices"
37+
38+
configs: nginx: data: "nginx.conf": """
39+
user nginx;
40+
worker_processes 1;
41+
error_log /var/log/nginx/error.log warn;
42+
pid /var/run/nginx.pid;
43+
events {
44+
worker_connections 1024;
45+
}
46+
http {
47+
include /etc/nginx/mime.types;
48+
default_type application/octet-stream;
49+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
50+
'$status $body_bytes_sent "$http_referer" '
51+
'"$http_user_agent" "$http_x_forwarded_for"';
52+
access_log /var/log/nginx/access.log main;
53+
sendfile on;
54+
keepalive_timeout 65;
55+
server {
56+
listen 8080;
57+
server_name localhost;
58+
59+
# https://cjycode.com/flutter_rust_bridge/manual/miscellaneous/web-cross-origin#background
60+
# https://drift.simonbinder.eu/platforms/web/#additional-headers
61+
add_header Cross-Origin-Opener-Policy "same-origin";
62+
add_header Cross-Origin-Embedder-Policy "require-corp";
63+
64+
location / {
65+
root /app;
66+
index index.html;
67+
try_files $uri $uri/ /index.html;
68+
}
69+
70+
# Ensure that /m4 (and any other SPA path) serves index.html
71+
location /m4 {
72+
root /app;
73+
try_files $uri $uri/ /index.html;
74+
}
75+
error_page 500 502 503 504 /50x.html;
76+
location = /50x.html {
77+
root /usr/share/nginx/html;
78+
}
79+
}
80+
}
81+
"""
82+
83+
dns: subdomain: "voices"
84+
route: rules: [{
85+
matchPrefix: "/"
86+
}]
87+
2688
service: {
27-
targetPort: 80
2889
port: 80
90+
targetPort: 8080
2991
}
3092
}
3193
}
3294
}
3395
}
96+
3497
release: {
3598
docker: {
3699
on: {

0 commit comments

Comments
 (0)