diff --git a/src/.vuepress/public/demo/FileUpload/.dockerignore b/src/.vuepress/public/demo/FileUpload/.dockerignore new file mode 100644 index 00000000..59869d01 --- /dev/null +++ b/src/.vuepress/public/demo/FileUpload/.dockerignore @@ -0,0 +1,4 @@ + +.git +node_modules +npm-debug.log \ No newline at end of file diff --git a/src/.vuepress/public/demo/FileUpload/BigFileUpload.html b/src/.vuepress/public/demo/FileUpload/BigFileUpload.html index 3d1932c6..b7a4e098 100644 --- a/src/.vuepress/public/demo/FileUpload/BigFileUpload.html +++ b/src/.vuepress/public/demo/FileUpload/BigFileUpload.html @@ -26,6 +26,7 @@ fileSize = 0, fileChunkListData = [], abortControllerList = []; + const HOST = "http://docker.songxingguo.com"; // 切换按钮状态 const toggleBtn = (isPause = true) => { const pauseBtn = document.getElementById("pause"); @@ -181,7 +182,7 @@ }) .map(async ({ formData, hash }) => { return requestApi({ - url: `http://localhost:3000`, + url: `${HOST}`, method: "POST", body: formData, onProgress: ({ loaded, total }) => { @@ -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", @@ -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", diff --git a/src/.vuepress/public/demo/FileUpload/Dockerfile b/src/.vuepress/public/demo/FileUpload/Dockerfile new file mode 100644 index 00000000..f1ce3dbb --- /dev/null +++ b/src/.vuepress/public/demo/FileUpload/Dockerfile @@ -0,0 +1,6 @@ +FROM node:20.12.1 +COPY . /app +WORKDIR /app +RUN npm install --registry=https://registry.npm.taobao.org +EXPOSE 3000 +CMD node server.js \ No newline at end of file diff --git a/src/.vuepress/public/demo/FileUpload/publish.sh b/src/.vuepress/public/demo/FileUpload/publish.sh new file mode 100755 index 00000000..4c75458a --- /dev/null +++ b/src/.vuepress/public/demo/FileUpload/publish.sh @@ -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 \ No newline at end of file