From 271590f7750a9ea10d63d4d04668020a9b40f0c8 Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Wed, 9 Jan 2019 09:36:29 +0100 Subject: [PATCH] Changed Dockerfile --- Dockerfile | 7 ++++--- main.go | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 62c085a..cba8ec0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,8 @@ RUN wget https://github.com/libvips/libvips/releases/download/v8.7.3/vips-8.7.3. cd vips-8.7.3 && \ ./configure && \ make && \ - make install + make install && \ + go get -v -u github.com/davidbyttow/govips/pkg/vips && \ + go install -v ./... -RUN go get -v -u github.com/davidbyttow/govips/pkg/vips -RUN go install -v ./... +CMD ["image-resizer", "-s", "https://images.example.com/"] diff --git a/main.go b/main.go index cddb5ea..eee402a 100644 --- a/main.go +++ b/main.go @@ -28,7 +28,7 @@ func main() { defer vips.Shutdown() http.HandleFunc("/", resizeHandler) - log.Fatal(http.ListenAndServe(listenAddr, nil)) + log.Fatal(http.ListenAndServe(*listenAddr, nil)) } func resizeHandler(w http.ResponseWriter, r *http.Request) { @@ -67,7 +67,7 @@ func resizeHandler(w http.ResponseWriter, r *http.Request) { } // Start fetching the image from the given url - resp, err := http.Get(imgServer + queryUrl) + resp, err := http.Get(*imgServer + queryUrl) if err != nil { w.Write([]byte(fmt.Sprintf("failed to get %s: %v", queryUrl, err))) w.WriteHeader(http.StatusBadRequest)