From 6733f46f58382e6f55314bc8e76f50cd4b5312a5 Mon Sep 17 00:00:00 2001 From: charlene tau express Date: Mon, 3 Mar 2025 17:15:32 +0800 Subject: [PATCH] working --- .dockerignore | 3 + Dockerfile | 23 ++++++ src/App.vue | 33 +++----- src/assets/base.css | 83 --------------------- src/assets/main.css | 10 +-- src/components/InputFieldCard.vue | 4 +- src/components/NavBars.vue | 8 +- src/components/TableComp.vue | 120 +++++++++++++++++++----------- src/shims-vue.d.ts | 6 ++ src/utils/{api.js => api.ts} | 3 + src/views/ResponseView.vue | 2 +- 11 files changed, 131 insertions(+), 164 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 src/shims-vue.d.ts rename src/utils/{api.js => api.ts} (98%) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a21f178 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +dist +.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a20a479 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Stage 1: Build the Vue App +FROM node:18 AS builder + +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm install + +COPY . . +RUN npm run build -- --force + + +# Stage 2: Serve the Built App Using Nginx +FROM nginx:alpine + +WORKDIR /usr/share/nginx/html +RUN rm -rf ./* +COPY --from=builder /app/dist ./ + +# Nginx Config +# COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/src/App.vue b/src/App.vue index ccbf04f..a10582c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,33 +1,20 @@