Changed Dockerfile

This commit is contained in:
Andreas Neue 2019-01-09 09:36:29 +01:00
parent 09c7df1091
commit 271590f775
2 changed files with 6 additions and 5 deletions

View File

@ -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/"]

View File

@ -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)