updates dockerfile to work with latest golang, adds .dockerignore, fixes CI (#4)

* adds support for https://github.com/golang/go/issues/32479

* updated dockerfile to work with latest golang, added .dockerignore
This commit is contained in:
Tai Groot 2020-10-14 23:41:45 -07:00 committed by GitHub
parent f72073e6ef
commit ead67c221f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
Dockerfile

View File

@ -15,5 +15,5 @@ COPY . /go/src/pastebin
RUN go get -v -d RUN go get -v -d
RUN go get github.com/GeertJohan/go.rice/rice RUN go get github.com/GeertJohan/go.rice/rice
RUN rice embed-go RUN GOROOT=/go rice embed-go
RUN go install -v RUN go install -v

View File

@ -8,6 +8,7 @@ import (
"log" "log"
"net/http" "net/http"
"net/url" "net/url"
"strconv"
"strings" "strings"
"time" "time"
@ -19,7 +20,7 @@ import (
"github.com/rcrowley/go-metrics/exp" "github.com/rcrowley/go-metrics/exp"
"github.com/thoas/stats" "github.com/thoas/stats"
"github.com/GeertJohan/go.rice" rice "github.com/GeertJohan/go.rice"
"github.com/julienschmidt/httprouter" "github.com/julienschmidt/httprouter"
"github.com/patrickmn/go-cache" "github.com/patrickmn/go-cache"
"github.com/renstrom/shortuuid" "github.com/renstrom/shortuuid"
@ -160,7 +161,7 @@ func (s *Server) DownloadHandler() httprouter.Handle {
w.Header().Set("Content-Disposition", "attachment; filename="+uuid) w.Header().Set("Content-Disposition", "attachment; filename="+uuid)
w.Header().Set("Content-Type", "application/octet-stream") w.Header().Set("Content-Type", "application/octet-stream")
w.Header().Set("Content-Length", string(content.Size())) w.Header().Set("Content-Length", strconv.FormatInt(content.Size(), 10))
http.ServeContent(w, r, uuid, time.Now(), content) http.ServeContent(w, r, uuid, time.Now(), content)
} }