Skip to content

Commit

Permalink
feat: docker发布
Browse files Browse the repository at this point in the history
  • Loading branch information
songxingguo committed Jun 12, 2024
1 parent 6dbfa0f commit 46ccdf0
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/.vuepress/public/demo/FileUpload/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

.git
node_modules
npm-debug.log
7 changes: 4 additions & 3 deletions src/.vuepress/public/demo/FileUpload/BigFileUpload.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
fileSize = 0,
fileChunkListData = [],
abortControllerList = [];
const HOST = "http://docker.songxingguo.com";
// 切换按钮状态
const toggleBtn = (isPause = true) => {
const pauseBtn = document.getElementById("pause");
Expand Down Expand Up @@ -181,7 +182,7 @@
})
.map(async ({ formData, hash }) => {
return requestApi({
url: `http://localhost:3000`,
url: `${HOST}`,
method: "POST",
body: formData,
onProgress: ({ loaded, total }) => {
Expand Down Expand Up @@ -217,7 +218,7 @@
// 合并分片
const mergeRequest = async (fileName, fileHash) => {
await requestApi({
url: "http://localhost:3000/merge",
url: `${HOST}/merge`,
method: "POST",
headers: {
"Content-Type": "application/json;charset=utf-8",
Expand All @@ -232,7 +233,7 @@
//文件秒传
const verifyUpload = async (filename, fileHash) => {
const data = await requestApi({
url: "http://localhost:3000/verify",
url: `${HOST}/verify"`,
method: "POST",
headers: {
"Content-Type": "application/json;charset=utf-8",
Expand Down
6 changes: 6 additions & 0 deletions src/.vuepress/public/demo/FileUpload/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:20.12.1
WORKDIR /app
COPY package.json server.js ./
RUN npm install
EXPOSE 3000
CMD node server.js
38 changes: 38 additions & 0 deletions src/.vuepress/public/demo/FileUpload/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/.vuepress/public/demo/FileUpload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "",
"main": "server.js",
"type":"module",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
Expand All @@ -12,6 +12,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"fs-extra": "^11.2.0",
"multiparty": "^4.2.3"
}
}
3 changes: 3 additions & 0 deletions src/.vuepress/public/demo/FileUpload/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker login --username=18983642737 registry.cn-shanghai.aliyuncs.com
docker build . --file Dockerfile --tag registry.cn-shanghai.aliyuncs.com/songxingguo/bigfileupload:latest
docker push registry.cn-shanghai.aliyuncs.com/songxingguo/bigfileupload:latest

0 comments on commit 46ccdf0

Please sign in to comment.