chore: add simple k8s deployment
This commit is contained in:
parent
12b1cf71ad
commit
22dfcb0265
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
node_modules/
|
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
FROM docker.io/node:22-alpine3.19 as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ADD . .
|
||||
|
||||
RUN npm install
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM docker.io/nginx:1.27.1-alpine
|
||||
|
||||
COPY --from=build /app/dist/ /www/page/
|
||||
|
||||
ADD nginx.conf /etc/nginx/conf.d/default.conf
|
40
deployment.yml
Normal file
40
deployment.yml
Normal file
@ -0,0 +1,40 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: automata-interview-service
|
||||
spec:
|
||||
selector:
|
||||
app/name: automata-interview
|
||||
ports:
|
||||
- name: http
|
||||
protocol: TCP
|
||||
port: 5005
|
||||
targetPort: 80
|
||||
externalIPs:
|
||||
- 192.168.1.102
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: automata-interview-deployment
|
||||
labels:
|
||||
app/name: automata-interview
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app/name: automata-interview
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app/name: automata-interview
|
||||
spec:
|
||||
containers:
|
||||
- name: automata-interview
|
||||
image: docker.andr3h3nriqu3s.com/automata-frontend-interview:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 80
|
||||
imagePullSecrets:
|
||||
- name: kronos-registry-secret
|
||||
|
10
nginx.conf
Normal file
10
nginx.conf
Normal file
@ -0,0 +1,10 @@
|
||||
server {
|
||||
listen 80;
|
||||
gzip_static on;
|
||||
|
||||
client_max_body_size 5G;
|
||||
|
||||
location / {
|
||||
root /www/page;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user