diff --git a/.env.prod b/.env.prod new file mode 100644 index 0000000..ed07d3a --- /dev/null +++ b/.env.prod @@ -0,0 +1,2 @@ +NODE_ENV = "prod" +VITE_ROOT_PATH = "/autoflow" \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..3af516b --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,30 @@ +module.exports = { + root: true, + env: { + node: true, + }, + extends: [ + "eslint:recommended", + "plugin:@vue/typescript/recommended", + "plugin:vue/vue3-recommended", + "plugin:prettier/recommended", + ], + parserOptions: { + parser: "@typescript-eslint/parser", + }, + rules: { + "vue/multi-word-component-names": "off", + "vue/comment-directive": "off", + "vue/no-v-html": "off", + "no-console": process.env.NODE_ENV === "prod" ? "warn" : "off", + "no-debugger": process.env.NODE_ENV === "prod" ? "warn" : "off", + "vue/no-deprecated-slot-attribute": "off", + "@typescript-eslint/no-explicit-any": "off", + "prettier/prettier": [ + "error", + { + endOfLine: "auto", + }, + ], + }, +}; diff --git a/Dockerfile_queenclient b/Dockerfile_queenclient new file mode 100644 index 0000000..4fe1aef --- /dev/null +++ b/Dockerfile_queenclient @@ -0,0 +1,9 @@ +FROM nginx:stable-alpine + +RUN apk --no-cache add tzdata && cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime + +COPY default.conf /etc/nginx/conf.d/default.conf + +COPY dist/. /usr/share/nginx/html/autoflow +EXPOSE 80 +ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/components.d.ts b/components.d.ts index e769ff9..de754fc 100644 --- a/components.d.ts +++ b/components.d.ts @@ -9,7 +9,6 @@ export {} declare module 'vue' { export interface GlobalComponents { AppFooter: typeof import('./src/components/AppFooter.vue')['default'] - copy: typeof import('./src/components/button/IconModifyBtn copy.vue')['default'] DrawerComponent: typeof import('./src/components/common/DrawerComponent.vue')['default'] FormComponent: typeof import('./src/components/run/experiment/FormComponent.vue')['default'] HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..857bc0f --- /dev/null +++ b/default.conf @@ -0,0 +1,16 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /autoflow/index.html; + } + + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/kubernetes/queenclient-deployment.yaml b/kubernetes/queenclient-deployment.yaml new file mode 100644 index 0000000..af60744 --- /dev/null +++ b/kubernetes/queenclient-deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: autoflow + namespace: autoflow + labels: + app: autoflow +spec: + replicas: 1 + selector: + matchLabels: + app: autoflow + template: + metadata: + labels: + app: autoflow + spec: + containers: + - image: 192.168.10.120:32100/autoflow:2025.07.005 + name: autoflow + ports: + - containerPort: 80 + resources: + requests: + cpu: 500m + memory: 100Mi + # limits: + # cpu: 1000m + # memory: 2Gi +--- +apiVersion: v1 +kind: Service +metadata: + name: autoflow + namespace: autoflow +spec: + type: ClusterIP + selector: + app: autoflow + ports: + - protocol: TCP + port: 80 + targetPort: 80 diff --git a/kubernetes/queenclient-ingress.yaml b/kubernetes/queenclient-ingress.yaml new file mode 100644 index 0000000..db39998 --- /dev/null +++ b/kubernetes/queenclient-ingress.yaml @@ -0,0 +1,19 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + namespace: autoflow + annotations: + nginx.ingress.kubernetes.io/proxy-body-size: 1g + name: autoflow +spec: + ingressClassName: nginx + rules: + - http: + paths: + - path: /autoflow + pathType: Prefix + backend: + service: + name: autoflow + port: + number: 80 diff --git a/package.json b/package.json index 9fd5be0..5f35bb0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "version": "0.0.0", "scripts": { "dev": "vite", - "build": "vite build", + "build": "vite build --mode prod", "preview": "vite preview", "lint": "eslint . --fix" }, diff --git a/vite.config.mjs b/vite.config.mjs index 0d08c1e..a94c4b5 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -1,19 +1,21 @@ // Plugins -import AutoImport from 'unplugin-auto-import/vite' -import Components from 'unplugin-vue-components/vite' -import Fonts from 'unplugin-fonts/vite' -import Layouts from 'vite-plugin-vue-layouts-next' -import Vue from '@vitejs/plugin-vue' -import VueRouter from 'unplugin-vue-router/vite' -import { VueRouterAutoImports } from 'unplugin-vue-router' -import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify' +import AutoImport from "unplugin-auto-import/vite"; +import Components from "unplugin-vue-components/vite"; +import Fonts from "unplugin-fonts/vite"; +import Layouts from "vite-plugin-vue-layouts-next"; +import Vue from "@vitejs/plugin-vue"; +import VueRouter from "unplugin-vue-router/vite"; +import { VueRouterAutoImports } from "unplugin-vue-router"; +import Vuetify, { transformAssetUrls } from "vite-plugin-vuetify"; // Utilities -import { defineConfig } from 'vite' -import { fileURLToPath, URL } from 'node:url' +import { defineConfig } from "vite"; +import { fileURLToPath, URL } from "node:url"; // https://vitejs.dev/config/ export default defineConfig({ + // 배포할때는 주석 풀기 + // base: "/autoflow/", plugins: [ VueRouter(), Layouts(), @@ -24,24 +26,26 @@ export default defineConfig({ Vuetify({ autoImport: true, styles: { - configFile: 'src/styles/settings.scss', + configFile: "src/styles/settings.scss", }, }), Components(), Fonts({ google: { - families: [{ - name: 'Roboto', - styles: 'wght@100;300;400;500;700;900', - }], + families: [ + { + name: "Roboto", + styles: "wght@100;300;400;500;700;900", + }, + ], }, }), AutoImport({ imports: [ - 'vue', + "vue", VueRouterAutoImports, { - pinia: ['defineStore', 'storeToRefs'], + pinia: ["defineStore", "storeToRefs"], }, ], eslintrc: { @@ -52,27 +56,19 @@ export default defineConfig({ ], optimizeDeps: { exclude: [ - 'vuetify', - 'vue-router', - 'unplugin-vue-router/runtime', - 'unplugin-vue-router/data-loaders', - 'unplugin-vue-router/data-loaders/basic', + "vuetify", + "vue-router", + "unplugin-vue-router/runtime", + "unplugin-vue-router/data-loaders", + "unplugin-vue-router/data-loaders/basic", ], }, - define: { 'process.env': {} }, + define: { "process.env": {} }, resolve: { alias: { - '@': fileURLToPath(new URL('src', import.meta.url)), + "@": fileURLToPath(new URL("src", import.meta.url)), }, - extensions: [ - '.js', - '.json', - '.jsx', - '.mjs', - '.ts', - '.tsx', - '.vue', - ], + extensions: [".js", ".json", ".jsx", ".mjs", ".ts", ".tsx", ".vue"], }, server: { port: 3000, @@ -80,11 +76,11 @@ export default defineConfig({ css: { preprocessorOptions: { sass: { - api: 'modern-compiler', + api: "modern-compiler", }, scss: { - api: 'modern-compiler', + api: "modern-compiler", }, }, }, -}) +});