Changed Dockerfile
This commit is contained in:
		
							parent
							
								
									09c7df1091
								
							
						
					
					
						commit
						271590f775
					
				
					 2 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -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/"]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue