From d2753d04b1430e15e337541b7b70c7164ab865df Mon Sep 17 00:00:00 2001 From: zyronon Date: Wed, 10 Jan 2024 16:07:45 +0800 Subject: [PATCH] add docker support --- Dockerfile | 6 ++++ README.md | 5 ++++ package.json | 80 ++++++++++++++++++++++++++-------------------------- 3 files changed, 51 insertions(+), 40 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..09c2657b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node +COPY . /root/typing-word +WORKDIR /root/typing-word +EXPOSE 3000 +RUN npm install +CMD ["npm", "start"] \ No newline at end of file diff --git a/README.md b/README.md index 4270c835..1d842eeb 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,11 @@ API 等词库。 尽可能满足大部分用户对背单词的需求,也非常 4. 执行`npm start`来启动项目,项目默认地址为[`http://localhost:3000`](http://localhost:3000) 5. 在浏览器中打开[`http://localhost:3000`](http://localhost:3000) 来访问项目。 +### 使用Docker +创建镜像 docker build -t typing-word:001 . + +启动容器 docker run --name typing-word -p 3000:3000 -d typing-word:001 + ## 📕 词库列表 - CET-4、CET-6、GMAT、GRE、IELTS、SAT、TOEFL、BEC diff --git a/package.json b/package.json index eb6428c0..1e44b89e 100644 --- a/package.json +++ b/package.json @@ -17,51 +17,51 @@ "i18n:write": "gulp i18nwrite" }, "dependencies": { - "@opentranslate/baidu": "^1.4.2", - "@opentranslate/translator": "^1.4.2", - "axios": "^1.5.0", - "compromise": "^14.10.0", - "copy-to-clipboard": "^3.3.3", - "element-plus": "^2.3.9", - "file-saver": "^2.0.5", - "git-last-commit": "^1.0.1", - "hover.css": "^2.3.2", - "localforage": "^1.10.0", - "lodash-es": "^4.17.21", - "mitt": "^3.0.1", - "nanoid": "^5.0.3", - "pinia": "^2.1.6", - "sentence-splitter": "^4.2.1", - "tesseract.js": "^4.1.1", - "vue": "^3.3.4", - "vue-activity-calendar": "^1.2.2", + "@opentranslate/baidu": "1.4.2", + "@opentranslate/translator": "1.4.2", + "axios": "1.5.0", + "compromise": "14.10.0", + "copy-to-clipboard": "3.3.3", + "element-plus": "2.3.9", + "file-saver": "2.0.5", + "git-last-commit": "1.0.1", + "hover.css": "2.3.2", + "localforage": "1.10.0", + "lodash-es": "4.17.21", + "mitt": "3.0.1", + "nanoid": "5.0.3", + "pinia": "2.1.6", + "sentence-splitter": "4.2.1", + "tesseract.js": "4.1.1", + "vue": "3.3.13", + "vue-activity-calendar": "1.2.2", "vue-i18n": "9", "vue-router": "4", "vue-virtual-scroller": "2.0.0-beta.8" }, "devDependencies": { - "@iconify/vue": "^4.1.1", - "@types/file-saver": "^2.0.5", - "@types/lodash-es": "^4.17.9", - "@types/uuid": "^9.0.4", - "@vitejs/plugin-vue": "^4.2.3", - "@vitejs/plugin-vue-jsx": "^3.0.1", - "@vue/compiler-sfc": "^3.3.4", - "commitizen": "^4.3.0", - "cz-conventional-changelog": "^3.3.0", - "esm": "^3.2.25", - "gulp": "^4.0.2", - "husky": "^8.0.3", - "push-dir": "^0.4.1", - "rollup-plugin-visualizer": "^5.9.2", - "sass": "^1.64.2", - "tslib": "^2.6.2", - "typescript": "^5.2.0", - "unplugin-auto-import": "^0.16.6", - "unplugin-vue-components": "^0.25.2", - "vite": "^4.4.5", - "vue-tsc": "^1.8.5", - "xlsx": "^0.18.5" + "@iconify/vue": "4.1.1", + "@types/file-saver": "2.0.5", + "@types/lodash-es": "4.17.9", + "@types/uuid": "9.0.4", + "@vitejs/plugin-vue": "4.2.3", + "@vitejs/plugin-vue-jsx": "3.0.1", + "@vue/compiler-sfc": "3.3.4", + "commitizen": "4.3.0", + "cz-conventional-changelog": "3.3.0", + "esm": "3.2.25", + "gulp": "4.0.2", + "husky": "8.0.3", + "push-dir": "0.4.1", + "rollup-plugin-visualizer": "5.9.2", + "sass": "1.64.2", + "tslib": "2.6.2", + "typescript": "5.2.0", + "unplugin-auto-import": "0.16.6", + "unplugin-vue-components": "0.25.2", + "vite": "4.4.5", + "vue-tsc": "1.8.5", + "xlsx": "0.18.5" }, "config": { "commitizen": {