diff --git a/Dockerfile b/Dockerfile index cccbb4a285f1f24b58ff8a996ff241a14d6cf77d..2c0fcb4372060e47f666000506e6c982e7884f9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,30 @@ -# Build stage +# 👉 Build stage FROM node:18 AS builder + WORKDIR /app +# ติดตั้ง dependencies COPY package*.json ./ RUN npm install +# คัดลอก source code ทั้งหมด COPY . . + +# สร้าง production build RUN npm run build -# Production stage +# 👉 Production stage FROM nginx:stable-alpine + +# คัดลอกไฟล์ที่ build แล้ว ไปยัง nginx COPY --from=builder /app/dist /usr/share/nginx/html -# copy nginx config if needed (optional) +# คัดลอก public folder เข้าไปด้วย (เผื่อมีรูปหรือ static อื่นๆ) +COPY public /usr/share/nginx/html + +# 🔧 (ถ้ามี custom nginx config) # COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 80 + CMD ["nginx", "-g", "daemon off;"] diff --git a/npm b/npm new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/assets/human.png b/public/img/human.png similarity index 100% rename from src/assets/human.png rename to public/img/human.png diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index 78ef34f7a8acf263072290b4c561c86806527af2..97cfb9d499def99dea30e797dd6e5b7240a55262 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -29,26 +29,15 @@ const onSubmit = async () => { <!-- Login Form --> <form> - <v-img src="\src\assets\human.png" height="100"></v-img> + <v-img src="./img/human.png" height="100"></v-img> <br /> <v-form ref="refForm" v-model="form" @submit.prevent="onSubmit"> - <v-text-field - v-model="email" - :rules="[required]" - density="compact" - placeholder="User" - prepend-inner-icon="mdi-account" - ></v-text-field> - <v-text-field - v-model="password" - :append-inner-icon="visible ? 'mdi-eye-off' : 'mdi-eye'" - :type="visible ? 'text' : 'password'" - density="compact" - placeholder="Enter your password" - prepend-inner-icon="mdi-lock-outline" - :rules="[(v) => !!v || 'Field is required']" - @click:append-inner="visible = !visible" - ></v-text-field> + <v-text-field v-model="email" :rules="[required]" density="compact" placeholder="User" + prepend-inner-icon="mdi-account"></v-text-field> + <v-text-field v-model="password" :append-inner-icon="visible ? 'mdi-eye-off' : 'mdi-eye'" + :type="visible ? 'text' : 'password'" density="compact" placeholder="Enter your password" + prepend-inner-icon="mdi-lock-outline" :rules="[(v) => !!v || 'Field is required']" + @click:append-inner="visible = !visible"></v-text-field> <br /> @@ -275,6 +264,7 @@ input[type='text']::placeholder { .underlineHover:hover:after { width: 100%; } + *:focus { outline: none; } @@ -286,5 +276,6 @@ input[type='text']::placeholder { * { box-sizing: border-box; } + /* text field */ </style> diff --git a/vite.config.ts b/vite.config.ts index 36c61875691ce720ebf98971095b49d1f25f43a2..6f051d9da661963615f199ef13dfec9f8aafa6d8 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,15 +1,12 @@ import { fileURLToPath, URL } from 'node:url' - import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [ - vue(), - vueJsx(), - ], + base: './', // ← เพิ่มบรรทัดนี้ + plugins: [vue(), vueJsx()], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url))