parent
be6bae7dcf
commit
d09e5aaf53
@ -0,0 +1,25 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: web
|
||||
labels:
|
||||
name: web
|
||||
spec:
|
||||
rules:
|
||||
- host: barretthousen.com
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/api"
|
||||
backend:
|
||||
service:
|
||||
name: proxy-client
|
||||
port:
|
||||
number: 80
|
||||
- pathType: ImplementationSpecific
|
||||
path: "/"
|
||||
backend:
|
||||
service:
|
||||
name: web-client
|
||||
port:
|
||||
number: 80
|
@ -0,0 +1,36 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: web-client
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: web-client
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: web-client
|
||||
spec:
|
||||
containers:
|
||||
- name: web-client
|
||||
image: barretthousen/service-web-client
|
||||
stdin: true
|
||||
tty: true
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
resources:
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: web-client
|
||||
spec:
|
||||
selector:
|
||||
app: web-client
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
@ -0,0 +1,42 @@
|
||||
FROM node:lts AS development
|
||||
|
||||
COPY . /opt/web-client
|
||||
|
||||
WORKDIR /opt/web-client
|
||||
|
||||
RUN npm install && npm install -g vite
|
||||
|
||||
CMD vite dev --port=80 --host=0.0.0.0 --strictPort --logLevel info
|
||||
|
||||
FROM node:lts AS build
|
||||
|
||||
ARG origin=https://barretthousen.com
|
||||
|
||||
ENV ENV=production
|
||||
|
||||
ENV PROTOCOL_HEADER=x-forwarded-proto
|
||||
ENV HOST_HEADER=x-forwarded-host
|
||||
ENV ADDRESS_HEADER=True-Client-IP
|
||||
ENV ORIGIN=${origin}
|
||||
|
||||
WORKDIR /opt/web-client
|
||||
|
||||
COPY --from=development /opt/web-client .
|
||||
|
||||
RUN npm build \
|
||||
&& cp -rv /opt/web-client/package.json /opt/web-client/build \
|
||||
&& cp -rv /opt/web-client/package-lock.json /opt/web-client/build
|
||||
|
||||
FROM node:lts AS production
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
COPY --from=build /var/web-client/build/* /opt/web-client
|
||||
|
||||
ENV PORT 80
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ['node']
|
||||
CMD ['web-client']
|
||||
|
Loading…
Reference in new issue