From 3432aed38b63e1c91a1c46ef47a479e7f29032c6 Mon Sep 17 00:00:00 2001 From: Dede Fuji Abdul Date: Wed, 17 Apr 2024 21:09:24 +0700 Subject: [PATCH 1/7] build image --- src/utils/api/api.graphql.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/api/api.graphql.ts b/src/utils/api/api.graphql.ts index 2970094..012359e 100755 --- a/src/utils/api/api.graphql.ts +++ b/src/utils/api/api.graphql.ts @@ -31,7 +31,7 @@ export const requestGraphQl = async (query: DocumentNode, data: any) => { export const apolloClient = () => { const httpLink = createHttpLink({ uri: import.meta.env.VITE_APP_GRAPHQL_ENDPOINT, - credentials: 'include' // Include credentials for cross-origin requests + credentials: 'include' }) const apolloClient = new ApolloClient({ From afbd3f2153102d55023cdf493ff70fbdf366e12e Mon Sep 17 00:00:00 2001 From: Dede Fuji Abdul Date: Wed, 17 Apr 2024 21:11:21 +0700 Subject: [PATCH 2/7] Refactor Dockerfile to use multi-stage build and optimize image size --- Dockerfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index a273d9b..77cf119 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,20 @@ # syntax=docker/dockerfile:1 # build stage -# FROM node:lts-alpine as builder -# WORKDIR /apkt -# COPY package*.json ./ -# RUN npm install && npm install npm-run-all -g -# COPY . . -# RUN npm run build -# # production stage -# FROM nginx:stable-alpine -# COPY --from=builder /apkt/dist /usr/share/nginx/html -# COPY --from=builder /apkt/nginx.conf /etc/nginx/nginx.conf -# EXPOSE 32166 -# CMD ["nginx", "-g", "daemon off;"] - +FROM node:lts-alpine as builder +WORKDIR /apkt +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build +# production stage FROM nginx:stable-alpine -COPY /dist /usr/share/nginx/html -COPY /nginx.conf /etc/nginx/nginx.conf +COPY --from=builder /apkt/dist /usr/share/nginx/html +COPY --from=builder /apkt/nginx.conf /etc/nginx/nginx.conf EXPOSE 32166 CMD ["nginx", "-g", "daemon off;"] + +# FROM nginx:stable-alpine +# COPY /dist /usr/share/nginx/html +# COPY /nginx.conf /etc/nginx/nginx.conf +# EXPOSE 32166 +# CMD ["nginx", "-g", "daemon off;"] From 64cd5930b6e26a123e7fc0e8e50f182503904f6d Mon Sep 17 00:00:00 2001 From: Dede Fuji Abdul Date: Wed, 17 Apr 2024 21:12:06 +0700 Subject: [PATCH 3/7] build image --- src/utils/api/api.graphql.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/api/api.graphql.ts b/src/utils/api/api.graphql.ts index 012359e..826b39b 100755 --- a/src/utils/api/api.graphql.ts +++ b/src/utils/api/api.graphql.ts @@ -20,7 +20,6 @@ const instance = axios.create({ }) export const getQueryString = (query: DocumentNode) => query.loc?.source.body! - export const requestGraphQl = async (query: DocumentNode, data: any) => { return await instance.post('', { query: getQueryString(query), From b7b022d80532879f388a9b939674abfd31c773b8 Mon Sep 17 00:00:00 2001 From: Dede Fuji Abdul Date: Wed, 17 Apr 2024 21:23:36 +0700 Subject: [PATCH 4/7] Refactor Dockerfile to use multi-stage build and optimize image size --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 77cf119..bc73d15 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,14 @@ -# syntax=docker/dockerfile:1 # build stage FROM node:lts-alpine as builder -WORKDIR /apkt +WORKDIR /app COPY package*.json ./ RUN npm install COPY . . RUN npm run build # production stage FROM nginx:stable-alpine -COPY --from=builder /apkt/dist /usr/share/nginx/html -COPY --from=builder /apkt/nginx.conf /etc/nginx/nginx.conf +COPY --from=builder /app/dist /usr/share/nginx/html +COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf EXPOSE 32166 CMD ["nginx", "-g", "daemon off;"] From ffc9ee780fda94b188890bf6e48b7bfdac6adf3d Mon Sep 17 00:00:00 2001 From: Dede Fuji Abdul Date: Wed, 17 Apr 2024 21:23:58 +0700 Subject: [PATCH 5/7] build image --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bc73d15..70e5487 100755 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,6 @@ COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf EXPOSE 32166 CMD ["nginx", "-g", "daemon off;"] - # FROM nginx:stable-alpine # COPY /dist /usr/share/nginx/html # COPY /nginx.conf /etc/nginx/nginx.conf From c0dfbc6b911372a8524455092a3a2a4ed4f4c331 Mon Sep 17 00:00:00 2001 From: Dede Fuji Abdul Date: Wed, 17 Apr 2024 21:32:10 +0700 Subject: [PATCH 6/7] Fix formatting issues in vite.config.ts --- vite.config.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 7809557..a40283c 100755 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,22 +10,22 @@ export default defineConfig({ vue({ template: { compilerOptions: { - isCustomElement: (tag) => ['lottie-player', 'center'].includes(tag), + isCustomElement: (tag) => ['lottie-player', 'center'].includes(tag) } } }), - vueJsx(), + vueJsx() ], resolve: { alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)), + '@': fileURLToPath(new URL('./src', import.meta.url)) } - }, - build: { - // outDir: 'build', - emptyOutDir: true, - chunkSizeWarningLimit: 4096, - // cssCodeSplit: true, - // cssMinify: true, } + // build: { + // // outDir: 'build', + // // emptyOutDir: true, + // // chunkSizeWarningLimit: 4096, + // // cssCodeSplit: true, + // // cssMinify: true, + // } }) From 2ccc4cce5246ec8bcb98d98dec145a308394b6e2 Mon Sep 17 00:00:00 2001 From: Dede Fuji Abdul Date: Wed, 17 Apr 2024 21:32:42 +0700 Subject: [PATCH 7/7] build image --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 70e5487..bc73d15 100755 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf EXPOSE 32166 CMD ["nginx", "-g", "daemon off;"] + # FROM nginx:stable-alpine # COPY /dist /usr/share/nginx/html # COPY /nginx.conf /etc/nginx/nginx.conf