-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3b7297
commit c43bc5e
Showing
8 changed files
with
161 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM node:18-alpine as builder | ||
WORKDIR /app | ||
COPY . . | ||
RUN npm ci | ||
RUN npm run build | ||
|
||
FROM nginx:stable-alpine | ||
WORKDIR /app/static | ||
COPY --from=builder /app/dist . | ||
COPY nginx.conf /etc/nginx/nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# When we deploy the frontend via docker we use nginx to serve | ||
# the static files. This configuration is a basic nginx config | ||
# that serves the static files from the /app/static directory | ||
# and hosts them on port 8080. | ||
# | ||
# It needs to match the setup in the Dockerfile (e.g. the | ||
# Dockerfile needs to put the files in /app/static and this | ||
# file needs to be placed at /etc/nginx/nginx.conf). | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include mime.types; | ||
sendfile on; | ||
|
||
server { | ||
listen 8080 default_server; | ||
listen [::]:8080; | ||
|
||
# Ideally, should figure this out. I believe it to be specific | ||
# to the environment. | ||
# resolver 127.0.0.11; | ||
|
||
# Since this is the default (and only server) we don't need a | ||
# valid server_name. _ is convention. | ||
server_name _; | ||
# Don't send nginx version in error pages. Not really needed. | ||
server_tokens off; | ||
|
||
root /app/static; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: backend | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: substrait-fiddle | ||
tier: backend | ||
template: | ||
metadata: | ||
labels: | ||
app: substrait-fiddle | ||
tier: backend | ||
spec: | ||
nodeSelector: | ||
cloud.google.com/compute-class: "Balanced" | ||
containers: | ||
- name: substrait-fiddle-backend | ||
image: us-central1-docker.pkg.dev/substrait-fiddle/substrait-fiddle-backend/substrait-fiddle-backend:0.0.1-alpha4 | ||
ports: | ||
- containerPort: 9090 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: backend | ||
labels: | ||
app: substrait-fiddle | ||
tier: backend | ||
spec: | ||
ports: | ||
- port: 9090 | ||
targetPort: 9090 | ||
selector: | ||
app: substrait-fiddle | ||
tier: backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: frontend | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: substrait-fiddle | ||
tier: frontend | ||
template: | ||
metadata: | ||
labels: | ||
app: substrait-fiddle | ||
tier: frontend | ||
spec: | ||
nodeSelector: | ||
cloud.google.com/compute-class: "Balanced" | ||
containers: | ||
- name: substrait-fiddle-frontend | ||
image: us-central1-docker.pkg.dev/substrait-fiddle/substrait-fiddle-frontend/substrait-fiddle-frontend:0.0.1-alpha1 | ||
ports: | ||
- containerPort: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: frontend | ||
labels: | ||
app: substrait-fiddle | ||
tier: frontend | ||
spec: | ||
ports: | ||
- port: 8080 | ||
targetPort: 8080 | ||
selector: | ||
app: substrait-fiddle | ||
tier: frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: substrait-fiddle-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: "gce" | ||
kubernetes.io/ingress.global-static-ip-name: substrait-fiddle-ip | ||
spec: | ||
ingressClassName: "gce" | ||
rules: | ||
- http: | ||
paths: | ||
- path: /* | ||
pathType: ImplementationSpecific | ||
backend: | ||
service: | ||
name: frontend | ||
port: | ||
number: 8080 | ||
- path: /api/* | ||
pathType: ImplementationSpecific | ||
backend: | ||
service: | ||
name: backend | ||
port: | ||
number: 9090 |