Skip to content

Commit 5d5ac20

Browse files
committed
feat api service and nginx
1 parent 4905d76 commit 5d5ac20

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

vite-project/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ RUN ls . \
55
&& mv /app/dist /usr/share/nginx/html \
66
&& rm -rf /app
77
EXPOSE 80
8+
COPY nginx.conf /etc/nginx/nginx.conf
89
CMD ["nginx", "-g", "daemon off;"]

vite-project/charts/templates/ingress.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,44 @@ spec:
3434
backend:
3535
service:
3636
name: gitdataweb-service
37+
port:
38+
number: 80
39+
---
40+
apiVersion: networking.k8s.io/v1
41+
kind: Ingress
42+
metadata:
43+
name: gitdataweb-api
44+
namespace: gitdata
45+
annotations:
46+
meta.helm.sh/release-name: gitdataweb-api
47+
nginx.ingress.kubernetes.io/rewrite-target: /
48+
nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
49+
nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
50+
nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
51+
nginx.ingress.kubernetes.io/enable-cors: "true"
52+
nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,User-Agent,X-Requested-With,Content-Type,Authorization,Origin,Accept,Access-Control-Request-Method,Access-Control-Request-Headers"
53+
nginx.ingress.kubernetes.io/cors-max-age: "86400"
54+
nginx.ingress.kubernetes.io/cors-allow-methods: "GET, PUT, POST, DELETE, PATCH, OPTIONS"
55+
nginx.ingress.kubernetes.io/cors-expose-headers: "Content-Length,Content-Range"
56+
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
57+
nginx.ingress.kubernetes.io/proxy-cookie-path: / /
58+
nginx.ingress.kubernetes.io/proxy-set-header: "Cookie $http_cookie"
59+
60+
labels:
61+
apptype: gitdataweb-api
62+
app.kubernetes.io/managed-by: Helm
63+
heritage: Helm
64+
release: gitdataweb-api
65+
spec:
66+
ingressClassName: ingress-nginx
67+
rules:
68+
- host: jzhub.io
69+
http:
70+
paths:
71+
- path: /api
72+
pathType: Prefix
73+
backend:
74+
service:
75+
name: gitdataos-svc
3776
port:
3877
number: 80

vite-project/nginx.conf

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
user nginx;
2+
worker_processes auto;
3+
4+
error_log /var/log/nginx/error.log notice;
5+
pid /var/run/nginx.pid;
6+
7+
events {
8+
worker_connections 1024;
9+
}
10+
http {
11+
include mime.types;
12+
default_type application/octet-stream;
13+
sendfile on;
14+
keepalive_timeout 65;
15+
server {
16+
listen 80;
17+
server_name localhost;
18+
location / {
19+
root html;
20+
index index.html index.htm;
21+
}
22+
error_page 500 502 503 504 /50x.html;
23+
location = /50x.html {
24+
root html;
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)