From 551f68a78a771dded3f5e92c04f7f50a87f20a99 Mon Sep 17 00:00:00 2001 From: levis Date: Thu, 19 Jun 2025 16:08:21 +0000 Subject: [PATCH 1/2] fix DockerFile --- .gitignore | 2 +- .../meta/76826e1b-f3fe-4cae-9f12-dbe86d416aaa.json | 1 - .nuxt/nuxt.d.ts | 2 +- .nuxt/tailwind/postcss.mjs | 4 ++-- .nuxt/tsconfig.json | 2 +- .nuxt/types/nitro-imports.d.ts | 4 ++-- .nuxt/types/plugins.d.ts | 3 +-- Dockerfile | 14 ++++---------- 8 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 .nuxt/manifest/meta/76826e1b-f3fe-4cae-9f12-dbe86d416aaa.json diff --git a/.gitignore b/.gitignore index 1b4d376..83c160e 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,5 @@ dist-ssr *.sln *.sw? - +.nuxt frontend.env diff --git a/.nuxt/manifest/meta/76826e1b-f3fe-4cae-9f12-dbe86d416aaa.json b/.nuxt/manifest/meta/76826e1b-f3fe-4cae-9f12-dbe86d416aaa.json deleted file mode 100644 index 9e26dfe..0000000 --- a/.nuxt/manifest/meta/76826e1b-f3fe-4cae-9f12-dbe86d416aaa.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.nuxt/nuxt.d.ts b/.nuxt/nuxt.d.ts index 3f6224e..e430094 100644 --- a/.nuxt/nuxt.d.ts +++ b/.nuxt/nuxt.d.ts @@ -1,10 +1,10 @@ /// /// /// +/// /// /// /// -/// /// /// /// diff --git a/.nuxt/tailwind/postcss.mjs b/.nuxt/tailwind/postcss.mjs index f17ebb6..0b11037 100644 --- a/.nuxt/tailwind/postcss.mjs +++ b/.nuxt/tailwind/postcss.mjs @@ -1,10 +1,10 @@ -// generated by the @nuxtjs/tailwindcss module at 6/18/2025, 8:40:13 AM +// generated by the @nuxtjs/tailwindcss module at 6/18/2025, 4:55:05 AM import "@nuxtjs/tailwindcss/config-ctx" import configMerger from "@nuxtjs/tailwindcss/merger"; import cfg2 from "./../../tailwind.config.ts"; const config = [ -{"content":{"files":["/Users/dkoziavin/code/sub-projects/e-book/components/**/*.{vue,js,jsx,mjs,ts,tsx}","/Users/dkoziavin/code/sub-projects/e-book/components/global/**/*.{vue,js,jsx,mjs,ts,tsx}","/Users/dkoziavin/code/sub-projects/e-book/components/**/*.{vue,js,jsx,mjs,ts,tsx}","/Users/dkoziavin/code/sub-projects/e-book/layouts/**/*.{vue,js,jsx,mjs,ts,tsx}","/Users/dkoziavin/code/sub-projects/e-book/plugins/**/*.{js,ts,mjs}","/Users/dkoziavin/code/sub-projects/e-book/composables/**/*.{js,ts,mjs}","/Users/dkoziavin/code/sub-projects/e-book/utils/**/*.{js,ts,mjs}","/Users/dkoziavin/code/sub-projects/e-book/pages/**/*.{vue,js,jsx,mjs,ts,tsx}","/Users/dkoziavin/code/sub-projects/e-book/{A,a}pp.{vue,js,jsx,mjs,ts,tsx}","/Users/dkoziavin/code/sub-projects/e-book/{E,e}rror.{vue,js,jsx,mjs,ts,tsx}","/Users/dkoziavin/code/sub-projects/e-book/app.config.{js,ts,mjs}"]}}, +{"content":{"files":["/home/levis/miduway/www/ebook.miduway.space/components/**/*.{vue,js,jsx,mjs,ts,tsx}","/home/levis/miduway/www/ebook.miduway.space/components/global/**/*.{vue,js,jsx,mjs,ts,tsx}","/home/levis/miduway/www/ebook.miduway.space/components/**/*.{vue,js,jsx,mjs,ts,tsx}","/home/levis/miduway/www/ebook.miduway.space/layouts/**/*.{vue,js,jsx,mjs,ts,tsx}","/home/levis/miduway/www/ebook.miduway.space/plugins/**/*.{js,ts,mjs}","/home/levis/miduway/www/ebook.miduway.space/composables/**/*.{js,ts,mjs}","/home/levis/miduway/www/ebook.miduway.space/utils/**/*.{js,ts,mjs}","/home/levis/miduway/www/ebook.miduway.space/pages/**/*.{vue,js,jsx,mjs,ts,tsx}","/home/levis/miduway/www/ebook.miduway.space/{A,a}pp.{vue,js,jsx,mjs,ts,tsx}","/home/levis/miduway/www/ebook.miduway.space/{E,e}rror.{vue,js,jsx,mjs,ts,tsx}","/home/levis/miduway/www/ebook.miduway.space/app.config.{js,ts,mjs}"]}}, {}, cfg2 ].reduce((acc, curr) => configMerger(acc, curr), {}); diff --git a/.nuxt/tsconfig.json b/.nuxt/tsconfig.json index 57e7bc3..674bfa0 100644 --- a/.nuxt/tsconfig.json +++ b/.nuxt/tsconfig.json @@ -119,7 +119,7 @@ "./imports" ], "#app-manifest": [ - "./manifest/meta/76826e1b-f3fe-4cae-9f12-dbe86d416aaa" + "./manifest/meta/e4f4ddb1-4c47-45da-a6d9-ad6f888061fb.json" ], "#components": [ "./components" diff --git a/.nuxt/types/nitro-imports.d.ts b/.nuxt/types/nitro-imports.d.ts index 0ea5be9..b78e405 100644 --- a/.nuxt/types/nitro-imports.d.ts +++ b/.nuxt/types/nitro-imports.d.ts @@ -137,5 +137,5 @@ export { useEvent } from 'nitropack/runtime/internal/context'; export { defineTask, runTask } from 'nitropack/runtime/internal/task'; export { defineNitroErrorHandler } from 'nitropack/runtime/internal/error/utils'; export { appendCorsHeaders, appendCorsPreflightHeaders, appendHeader, appendHeaders, appendResponseHeader, appendResponseHeaders, assertMethod, callNodeListener, clearResponseHeaders, clearSession, createApp, createAppEventHandler, createError, createEvent, createEventStream, createRouter, defaultContentType, defineEventHandler, defineLazyEventHandler, defineNodeListener, defineNodeMiddleware, defineRequestMiddleware, defineResponseMiddleware, defineWebSocket, defineWebSocketHandler, deleteCookie, dynamicEventHandler, eventHandler, fetchWithEvent, fromNodeMiddleware, fromPlainHandler, fromWebHandler, getCookie, getHeader, getHeaders, getMethod, getProxyRequestHeaders, getQuery, getRequestFingerprint, getRequestHeader, getRequestHeaders, getRequestHost, getRequestIP, getRequestPath, getRequestProtocol, getRequestURL, getRequestWebStream, getResponseHeader, getResponseHeaders, getResponseStatus, getResponseStatusText, getRouterParam, getRouterParams, getSession, getValidatedQuery, getValidatedRouterParams, handleCacheHeaders, handleCors, isCorsOriginAllowed, isError, isEvent, isEventHandler, isMethod, isPreflightRequest, isStream, isWebResponse, lazyEventHandler, parseCookies, promisifyNodeListener, proxyRequest, readBody, readFormData, readMultipartFormData, readRawBody, readValidatedBody, removeResponseHeader, sanitizeStatusCode, sanitizeStatusMessage, sealSession, send, sendError, sendIterable, sendNoContent, sendProxy, sendRedirect, sendStream, sendWebResponse, serveStatic, setCookie, setHeader, setHeaders, setResponseHeader, setResponseHeaders, setResponseStatus, splitCookiesString, toEventHandler, toNodeListener, toPlainHandler, toWebHandler, toWebRequest, unsealSession, updateSession, useBase, useSession, writeEarlyHints } from 'h3'; -export { buildAssetsURL as __buildAssetsURL, publicAssetsURL as __publicAssetsURL } from '/Users/dkoziavin/code/sub-projects/e-book/node_modules/nuxt/dist/core/runtime/nitro/utils/paths'; -export { defineAppConfig } from '/Users/dkoziavin/code/sub-projects/e-book/node_modules/nuxt/dist/core/runtime/nitro/utils/config'; \ No newline at end of file +export { buildAssetsURL as __buildAssetsURL, publicAssetsURL as __publicAssetsURL } from '/home/levis/miduway/www/ebook.miduway.space/node_modules/nuxt/dist/core/runtime/nitro/utils/paths'; +export { defineAppConfig } from '/home/levis/miduway/www/ebook.miduway.space/node_modules/nuxt/dist/core/runtime/nitro/utils/config'; \ No newline at end of file diff --git a/.nuxt/types/plugins.d.ts b/.nuxt/types/plugins.d.ts index 1f38721..857307e 100644 --- a/.nuxt/types/plugins.d.ts +++ b/.nuxt/types/plugins.d.ts @@ -9,7 +9,6 @@ type NuxtAppInjections = InjectionType & InjectionType & InjectionType & - InjectionType & InjectionType & InjectionType & InjectionType & @@ -23,7 +22,7 @@ declare module '#app' { interface NuxtApp extends NuxtAppInjections { } interface NuxtAppLiterals { - pluginName: 'nuxt:revive-payload:client' | 'nuxt:head' | 'nuxt:router' | 'nuxt:debug:hooks' | 'nuxt:payload' | 'nuxt:revive-payload:server' | 'nuxt:chunk-reload' | 'pinia' | 'nuxt:global-components' | 'nuxt:prefetch' | '@nuxt/icon' + pluginName: 'nuxt:revive-payload:client' | 'nuxt:head' | 'nuxt:router' | 'nuxt:payload' | 'nuxt:revive-payload:server' | 'nuxt:chunk-reload' | 'pinia' | 'nuxt:global-components' | 'nuxt:prefetch' | '@nuxt/icon' } } diff --git a/Dockerfile b/Dockerfile index 79f687f..e78b90e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,7 @@ -FROM node:20 as builder - -WORKDIR /app -COPY package*.json ./ +FROM node:18-alpine +WORKDIR /usr/src/app +COPY package*..json ./ RUN npm install COPY . . RUN npm run build - -FROM nginx:alpine -COPY --from=builder /app/dist /usr/share/nginx/html -COPY ebook.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["node", ".dist/server/index.mjs"] From 76aa42dc2513f5d3e484912c07a8c976e9bc1f2a Mon Sep 17 00:00:00 2001 From: levis Date: Thu, 19 Jun 2025 16:59:26 +0000 Subject: [PATCH 2/2] fix DockerFile --- .gitea/workflows/deploy.yml | 44 +++++++++++++++++++++++-------------- .nuxt/nuxt.d.ts | 2 +- .nuxt/tailwind/postcss.mjs | 2 +- .nuxt/tsconfig.json | 2 +- Dockerfile | 6 ++--- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 71f5555..91202c7 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy Application +name: Deploy Nuxt App on: [push] jobs: @@ -8,27 +8,37 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - token: 0406afe7de6547e850dd62c84976c6def23a5193 + token: ${{ secrets.TOKEN }} - - name: Install curl + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '22' + + - name: Install dependencies and build run: | - if command -v apt-get &> /dev/null; then - apt-get update && apt-get install -y curl - elif command -v apk &> /dev/null; then - apk add --no-cache curl - elif command -v yum &> /dev/null; then - yum install -y curl - fi + npm install + npm run build - - name: Upload config files to server + - name: Prepare deployment files + run: | + tar -czf deploy.tar.gz dist Dockerfile docker-compose.yml + + - name: Upload files via Gitea API env: - GITEA_API: "https://gitea.miduway.space/api/v1/repos/levis/ebook/raw/main" - GITEA_TOKEN: "0406afe7de6547e850dd62c84976c6def23a5193" + GITEA_API: "https://gitea.miduway.space/api/v1/repos/levis/ebook/raw/production" + GITEA_TOKEN: ${{ secrets.TOKEN }} run: | - for file in docker-compose.yml Dockerfile; do - echo "Uploading $file" + for file in Dockerfile docker-compose.yml; do curl -X PUT \ - -H "Authorization: token $GITEA_TOKEN" \ + -H "Authorization: token $TOKEN" \ + -H "Content-Type: text/plain" \ -T "$file" \ - "$GITEA_API/$file" + "$GITEA_API/$file?branch=main" done + + curl -X PUT \ + -H "Authorization: token $TOKEN" \ + -H "Content-Type: application/gzip" \ + -T "deploy.tar.gz" \ + "$GITEA_API/deploy.tar.gz?branch=main" diff --git a/.nuxt/nuxt.d.ts b/.nuxt/nuxt.d.ts index e430094..20d4c26 100644 --- a/.nuxt/nuxt.d.ts +++ b/.nuxt/nuxt.d.ts @@ -1,9 +1,9 @@ /// /// /// -/// /// /// +/// /// /// /// diff --git a/.nuxt/tailwind/postcss.mjs b/.nuxt/tailwind/postcss.mjs index 0b11037..9cd5847 100644 --- a/.nuxt/tailwind/postcss.mjs +++ b/.nuxt/tailwind/postcss.mjs @@ -1,4 +1,4 @@ -// generated by the @nuxtjs/tailwindcss module at 6/18/2025, 4:55:05 AM +// generated by the @nuxtjs/tailwindcss module at 6/19/2025, 4:53:06 PM import "@nuxtjs/tailwindcss/config-ctx" import configMerger from "@nuxtjs/tailwindcss/merger"; diff --git a/.nuxt/tsconfig.json b/.nuxt/tsconfig.json index 674bfa0..e1afd5b 100644 --- a/.nuxt/tsconfig.json +++ b/.nuxt/tsconfig.json @@ -119,7 +119,7 @@ "./imports" ], "#app-manifest": [ - "./manifest/meta/e4f4ddb1-4c47-45da-a6d9-ad6f888061fb.json" + "./manifest/meta/f4dfbb73-66a7-4162-b534-4c8db9f3aa74.json" ], "#components": [ "./components" diff --git a/Dockerfile b/Dockerfile index e78b90e..b29ac53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM node:18-alpine +FROM node:22-alpine WORKDIR /usr/src/app -COPY package*..json ./ +COPY package*.json ./ RUN npm install COPY . . RUN npm run build -CMD ["node", ".dist/server/index.mjs"] +CMD ["node", "dist/server/index.mjs"]