build docker
This commit is contained in:
1 parent
903e7040f0
commit
ed255ee070
11 files changed
+54
-94
No files matched your search
+2
-1
@@ -1,7 +1,7 @@
|
||||
# build stage
|
||||
FROM node:lts-alpine as build-stage
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn
|
||||
COPY . .
|
||||
RUN yarn build
|
||||
@@ -9,5 +9,6 @@ RUN yarn build
|
||||
# production stage
|
||||
FROM nginx:stable-alpine as production-stage
|
||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -2,23 +2,23 @@ apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: zhishuyun-frontend
|
||||
name: zhishuyun-frontend
|
||||
app: zhishuyun-auth-frontend
|
||||
name: zhishuyun-auth-frontend
|
||||
namespace: zhishuyun
|
||||
spec:
|
||||
replicas: 2
|
||||
revisionHistoryLimit: 1
|
||||
revisionHistoryLimit: 5
|
||||
selector:
|
||||
matchLabels:
|
||||
app: zhishuyun-frontend
|
||||
app: zhishuyun-auth-frontend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: zhishuyun-frontend
|
||||
app: zhishuyun-auth-frontend
|
||||
spec:
|
||||
containers:
|
||||
- image: zhishuyun/frontend:${TAG}
|
||||
name: zhishuyun-frontend
|
||||
- image: zhishuyun/auth-frontend:${TAG}
|
||||
name: zhishuyun-auth-frontend
|
||||
ports:
|
||||
- containerPort: 80
|
||||
resources:
|
||||
@@ -28,4 +28,6 @@ spec:
|
||||
limits:
|
||||
memory: '512Mi'
|
||||
cpu: '200m'
|
||||
imagePullSecrets:
|
||||
- name: docker-registry
|
||||
restartPolicy: Always
|
||||
@@ -1,7 +1,7 @@
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: ingress-zhishuyun-frontend
|
||||
name: ingress-zhishuyun-auth-frontend
|
||||
namespace: zhishuyun
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: 'nginx'
|
||||
@@ -10,13 +10,13 @@ metadata:
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- www.zhishuyun.com
|
||||
secretName: tls-www-zhishuyun-com
|
||||
- auth.zhishuyun.com
|
||||
secretName: tls-auth-zhishuyun-com
|
||||
rules:
|
||||
- host: www.zhishuyun.com
|
||||
- host: auth.zhishuyun.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: zhishuyun-frontend
|
||||
serviceName: zhishuyun-auth-frontend
|
||||
servicePort: 8083
|
||||
path: /
|
||||
@@ -2,8 +2,8 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: zhishuyun-frontend
|
||||
name: zhishuyun-frontend
|
||||
app: zhishuyun-auth-frontend
|
||||
name: zhishuyun-auth-frontend
|
||||
namespace: zhishuyun
|
||||
spec:
|
||||
ports:
|
||||
@@ -11,4 +11,4 @@ spec:
|
||||
port: 8083
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: zhishuyun-frontend
|
||||
app: zhishuyun-auth-frontend
|
||||
@@ -0,0 +1,8 @@
|
||||
version: '3'
|
||||
services:
|
||||
zhishuyun-auth-frontend:
|
||||
container_name: 'zhishuyun-auth-frontend'
|
||||
build: ./
|
||||
image: 'ghcr.io/zhishuyun/zhishuyun-auth-frontend:${BUILD_NUMBER}'
|
||||
ports:
|
||||
- '8083:80'
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://zhishuyun-auth-backend:8000/api/;
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
error_page 404 /404.html;
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "zhishuyun",
|
||||
"version": "0.0.1",
|
||||
"name": "zhishuyun-auth",
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"start": "vite --host",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
<template>
|
||||
<full-loading
|
||||
v-model:active="showing"
|
||||
color="#409eff"
|
||||
loader="bars"
|
||||
:opacity="0.8"
|
||||
:can-cancel="true"
|
||||
:on-cancel="undefined"
|
||||
:is-full-page="true"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import FullLoading from 'vue-loading-overlay';
|
||||
import 'vue-loading-overlay/dist/vue-loading.css';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Loading',
|
||||
components: {
|
||||
FullLoading
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showing: false
|
||||
};
|
||||
},
|
||||
props: {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
delay: {
|
||||
type: Number,
|
||||
default: 200
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
loading: {
|
||||
handler(val, oldVal) {
|
||||
if (oldVal === true && val === false) {
|
||||
setTimeout(() => {
|
||||
this.showing = val;
|
||||
}, this.delay);
|
||||
} else {
|
||||
this.showing = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -1,6 +1,5 @@
|
||||
import TopHeader from './TopHeader.vue';
|
||||
import Breadcrumb from './Breadcrumb.vue';
|
||||
import Loading from './Loading.vue';
|
||||
import SuccessInfo from './SuccessInfo.vue';
|
||||
import Pagination from './Pagination.vue';
|
||||
export { TopHeader, Breadcrumb, Loading, SuccessInfo, Pagination };
|
||||
export { TopHeader, Breadcrumb, SuccessInfo, Pagination };
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
import Constants from './constants';
|
||||
import Methods from './methods';
|
||||
|
||||
export { Constants, Methods };
|
||||
export { Methods };
|
||||
@@ -1,20 +0,0 @@
|
||||
<template>
|
||||
<div>Home</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { LayoutHome } from '@/layouts/index';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LayoutHome
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
Reference in new issue
Block a user