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 09ace25
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 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
COPY . /app
WORKDIR /app
RUN npm install --registry=https://registry.npm.taobao.org
EXPOSE 3000
CMD node server.js
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 09ace25

Please sign in to comment.