Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 添加一些部署文件
gaoSir79e94cc0fda9
diff --git a/.env.production b/.env.productionindex 36bf65f2..95bdf1ec 100644--- a/.env.production+++ b/.env.production@@ -1,4 +1,3 @@NEXT_PUBLIC_EVN=prodNEXT_PUBLIC_API_URL=https://apitest.aiearn.ai/api/-diff --git a/.idea/workspace.xml b/.idea/workspace.xmlindex c14d6895..a97f7c58 100644--- a/.idea/workspace.xml+++ b/.idea/workspace.xml@@ -4,20 +4,13 @@<option name="autoReloadType" value="SELECTIVE" /></component><component name="ChangeListManager">- <list default="true" id="90ed3383-49aa-4e32-95a2-9f070c0da49b" name="更改" comment="refactor(发布): 旧发布和发布记录全部删除">- <change afterPath="$PROJECT_DIR$/src/app/i18n/locales/en/material.json" afterDir="false" />- <change afterPath="$PROJECT_DIR$/src/app/i18n/locales/zh-CN/material.json" afterDir="false" />- <change beforePath="$PROJECT_DIR$/.env" beforeDir="false" afterPath="$PROJECT_DIR$/.env" afterDir="false" />+ <list default="true" id="90ed3383-49aa-4e32-95a2-9f070c0da49b" name="更改" comment="fix: 修复类型错误,更改next配置">+ <change afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />+ <change afterPath="$PROJECT_DIR$/deploy/docker-compose.yaml" afterDir="false" /><change beforePath="$PROJECT_DIR$/.env.production" beforeDir="false" afterPath="$PROJECT_DIR$/.env.production" afterDir="false" /><change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />- <change beforePath="$PROJECT_DIR$/@types/resources.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/@types/resources.d.ts" afterDir="false" />- <change beforePath="$PROJECT_DIR$/next.config.mjs" beforeDir="false" afterPath="$PROJECT_DIR$/next.config.mjs" afterDir="false" /><change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />- <change beforePath="$PROJECT_DIR$/pm2.json" beforeDir="false" afterPath="$PROJECT_DIR$/pm2.json" afterDir="false" />- <change beforePath="$PROJECT_DIR$/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx" afterDir="false" />- <change beforePath="$PROJECT_DIR$/src/app/[lng]/cgmaterial/page.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/cgmaterial/page.tsx" afterDir="false" />- <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/demoPageCore.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/demo/demoPageCore.tsx" afterDir="false" />- <change beforePath="$PROJECT_DIR$/src/store/bellMessageStroe.ts" beforeDir="false" />+ <change beforePath="$PROJECT_DIR$/src/middleware.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/middleware.ts" afterDir="false" /></list><option name="SHOW_DIALOG" value="false" /><option name="HIGHLIGHT_CONFLICTS" value="true" />@@ -57,27 +50,27 @@<option name="hideEmptyMiddlePackages" value="true" /><option name="showLibraryContents" value="true" /></component>- <component name="PropertiesComponent">{- "keyToString": {- "ASKED_ADD_EXTERNAL_FILES": "true",- "ASKED_MARK_IGNORED_FILES_AS_EXCLUDED": "true",- "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",- "RunOnceActivity.ShowReadmeOnStart": "true",- "SHARE_PROJECT_CONFIGURATION_FILES": "true",- "git-widget-placeholder": "master",- "ignore.virus.scanning.warn.message": "true",- "last_opened_file_path": "E:/project-dev/web/艺咖/aitoearn-web/src/components/PublishDialog/hooks",- "node.js.detected.package.eslint": "true",- "node.js.detected.package.tslint": "true",- "node.js.selected.package.eslint": "(autodetect)",- "node.js.selected.package.tslint": "(autodetect)",- "nodejs_package_manager_path": "npm",- "run.code.analysis.last.selected.profile": "pProject Default",- "settings.editor.selected.configurable": "editor.reader.mode",- "ts.external.directory.path": "E:\\project-dev\\web\\艺咖\\aitoearn-web\\node_modules\\typescript\\lib",- "vue.rearranger.settings.migration": "true"+ <component name="PropertiesComponent"><![CDATA[{+ "keyToString": {+ "ASKED_ADD_EXTERNAL_FILES": "true",+ "ASKED_MARK_IGNORED_FILES_AS_EXCLUDED": "true",+ "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",+ "RunOnceActivity.ShowReadmeOnStart": "true",+ "SHARE_PROJECT_CONFIGURATION_FILES": "true",+ "git-widget-placeholder": "master",+ "ignore.virus.scanning.warn.message": "true",+ "last_opened_file_path": "E:/project-dev/web/艺咖/aitoearn-web",+ "node.js.detected.package.eslint": "true",+ "node.js.detected.package.tslint": "true",+ "node.js.selected.package.eslint": "(autodetect)",+ "node.js.selected.package.tslint": "(autodetect)",+ "nodejs_package_manager_path": "npm",+ "run.code.analysis.last.selected.profile": "pProject Default",+ "settings.editor.selected.configurable": "editor.reader.mode",+ "ts.external.directory.path": "E:\\project-dev\\web\\艺咖\\aitoearn-web\\node_modules\\typescript\\lib",+ "vue.rearranger.settings.migration": "true"}-}</component>+}]]></component><component name="ReactBuddySettings"><option name="extensionsIgnore" value="true" /></component>@@ -92,6 +85,7 @@</component><component name="RecentsManager"><key name="CopyFile.RECENT_KEYS">+ <recent name="E:\project-dev\web\艺咖\aitoearn-web" /><recent name="E:\project-dev\web\艺咖\aitoearn-web\src\components\PublishDialog\hooks" /><recent name="E:\project-dev\web\艺咖\aitoearn-web\src\components\PublishDialog\compoents\PubParmasTextarea\components" /><recent name="E:\project-dev\web\艺咖\aitoearn-web\src\components\PublishDialog\plats" />@@ -131,7 +125,7 @@<workItem from="1751273285905" duration="3882000" /><workItem from="1751278214456" duration="955000" /><workItem from="1751334170049" duration="2844000" />- <workItem from="1751351785412" duration="20814000" />+ <workItem from="1751351785412" duration="26981000" /></task><task id="LOCAL-00001" summary="feat: 日历完善"><option name="closed" value="true" />@@ -309,7 +303,15 @@<option name="project" value="LOCAL" /><updated>1751441171457</updated></task>- <option name="localTasksCounter" value="23" />+ <task id="LOCAL-00023" summary="fix: 修复类型错误,更改next配置">+ <option name="closed" value="true" />+ <created>1751445479615</created>+ <option name="number" value="00023" />+ <option name="presentableId" value="LOCAL-00023" />+ <option name="project" value="LOCAL" />+ <updated>1751445479615</updated>+ </task>+ <option name="localTasksCounter" value="24" /><servers /></component><component name="TypeScriptGeneratedFilesManager">@@ -351,6 +353,7 @@<MESSAGE value="feat: 拖动调整完成(目前等待接接口)" /><MESSAGE value="feat: 授权改到后端" /><MESSAGE value="refactor(发布): 旧发布和发布记录全部删除" />- <option name="LAST_COMMIT_MESSAGE" value="refactor(发布): 旧发布和发布记录全部删除" />+ <MESSAGE value="fix: 修复类型错误,更改next配置" />+ <option name="LAST_COMMIT_MESSAGE" value="fix: 修复类型错误,更改next配置" /></component></project>\ No newline at end of filediff --git a/Dockerfile b/Dockerfilenew file mode 100644index 00000000..c8faa822--- /dev/null+++ b/Dockerfile@@ -0,0 +1,7 @@+FROM node:18-alpine AS base++FROM base AS deps++RUN apk add --no-cache libc6-compat++WORKDIR /appdiff --git a/deploy/docker-compose.yaml b/deploy/docker-compose.yamlnew file mode 100644index 00000000..5db57d27--- /dev/null+++ b/deploy/docker-compose.yaml@@ -0,0 +1,11 @@+version: "3.8"++services:+ aitoearn-web:+ image: next-base-image+ container_name: aitoearn-web+ ports:+ - "3000:3000"+ volumes:+ - ./standalone:/app+ command: node server.js\ No newline at end of filediff --git a/package.json b/package.jsonindex 3ce1b01f..6a6ac314 100644--- a/package.json+++ b/package.json@@ -5,7 +5,8 @@"scripts": {"postbuild": "next-sitemap","dev": "next dev --experimental-https",- "build": "tsc && next build",+ "build": "tsc && next build && npm run copy-static",+ "copy-static": "xcopy public .next\\standalone\\public /E /I /Y && if exist .next\\static xcopy .next\\static .next\\standalone\\.next\\static /E /I /Y","start": "next start","lint": "next lint","migrateToLocize": "locize migrate --project-id=01b2e5e8-6243-47d1-b36f-963dbb8bcae3 --api-key=c9805cd1-fd50-4d98-967a-383b39066de8 --path=./app/i18n/locales",diff --git a/src/middleware.ts b/src/middleware.tsindex 5e2bd085..9e39f4b8 100644--- a/src/middleware.ts+++ b/src/middleware.ts@@ -16,6 +16,9 @@ export function middleware(req: NextRequest) {if (ProxyUrls.find((v) => req.nextUrl.pathname.includes(v!))) {return NextResponse.next();}+ if (["/robots.txt", "/sitemap.xml"].find((v) => req.nextUrl.pathname.includes(v!))) {+ return NextResponse.next();+ }if (req.nextUrl.pathname.indexOf("icon") > -1 ||