File tree Expand file tree Collapse file tree 3 files changed +38
-8
lines changed Expand file tree Collapse file tree 3 files changed +38
-8
lines changed Original file line number Diff line number Diff line change 11FROM registry.cn-hangzhou.aliyuncs.com/prince/alpine-golang:1.11.5 as builder
22MAINTAINER prince <
[email protected] >
3- ARG VERSION=1.0.9
3+ ARG VERSION=1.1.4
44RUN set -xe; \
55 apk update; \
66 apk add --no-cache --virtual .build-deps \
@@ -17,10 +17,6 @@ COPY --from=builder /go/src/go-fastdfs/fileserver /
1717ENV INSTALL_DIR /usr/local/go-fastdfs
1818
1919RUN mkdir -p $INSTALL_DIR; \
20- mkdir -p $INSTALL_DIR/conf; \
21- mkdir -p $INSTALL_DIR/data; \
22- mkdir -p $INSTALL_DIR/files; \
23- mkdir -p $INSTALL_DIR/log; \
2420 mv /fileserver $INSTALL_DIR/; \
2521 chmod +x $INSTALL_DIR/fileserver;
2622
Original file line number Diff line number Diff line change @@ -315,7 +315,13 @@ culr -C - http://10.1.5.9:8080/group1/default/20190128/16/10/2G
315315
316316- Docker如何部署?
317317```
318- 使用环境变量 GO_FASTDFS_DIR 指向存储目录。
318+
319+
320+ 步骤:
321+ 一、构建镜像
322+ docker build . -t fastdfs
323+ 二、运行容器(使用环境变量 GO_FASTDFS_DIR 指向存储目录。)
324+ docker run --name fastdfs -v ~:/data/fastdfs -e GO_FASTDFS_DIR=/data/fastdfs fastdfs
319325
320326```
321327
Original file line number Diff line number Diff line change 55 "crypto/rand"
66 "crypto/sha1"
77 "encoding/base64"
8- "runtime"
98 random "math/rand"
10-
9+ "runtime"
1110 "errors"
1211 "flag"
1312 "fmt"
@@ -40,6 +39,8 @@ import (
4039 "github.com/json-iterator/go"
4140 log "github.com/sjqzhang/seelog"
4241 "github.com/syndtr/goleveldb/leveldb"
42+ "github.com/tus/tusd"
43+ "github.com/tus/tusd/filestore"
4344)
4445
4546var staticHandler http.Handler
@@ -3486,6 +3487,30 @@ func (this *Server) test() {
34863487
34873488}
34883489
3490+ func (this * Server ) initTus () {
3491+ store := filestore.FileStore {
3492+ Path : STORE_DIR ,
3493+ }
3494+ bigDir := "/big/"
3495+ composer := tusd .NewStoreComposer ()
3496+ store .UseIn (composer )
3497+ handler , err := tusd .NewHandler (tusd.Config {
3498+ BasePath : bigDir ,
3499+ StoreComposer : composer ,
3500+ })
3501+ if err != nil {
3502+ log .Error (err )
3503+
3504+ }
3505+
3506+ if Config ().SupportGroupManage {
3507+ http .Handle ("/" + Config ().Group + bigDir , http .StripPrefix ("/" + Config ().Group + bigDir , handler ))
3508+ } else {
3509+ http .Handle (bigDir , http .StripPrefix (bigDir , handler ))
3510+
3511+ }
3512+ }
3513+
34893514func (this * Server ) FormatStatInfo () {
34903515 var (
34913516 data []byte
@@ -3559,9 +3584,12 @@ func (this *Server) initComponent(isReload bool) {
35593584
35603585 if ! isReload {
35613586 this .FormatStatInfo ()
3587+ this .initTus ()
35623588 }
35633589 //Timer
35643590
3591+ // int tus
3592+
35653593}
35663594
35673595type HttpHandler struct {
You can’t perform that action at this time.
0 commit comments