Add build dockerfile
This commit is contained in:
		
							
								
								
									
										17
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | |||||||
|  | FROM golang:1.21 as build | ||||||
|  |  | ||||||
|  | WORKDIR /godoor | ||||||
|  |  | ||||||
|  | # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change | ||||||
|  | COPY go.mod go.sum ./ | ||||||
|  | RUN go mod download && go mod verify | ||||||
|  |  | ||||||
|  |  | ||||||
|  | COPY . . | ||||||
|  | RUN make build | ||||||
|  |  | ||||||
|  | FROM scratch | ||||||
|  | WORKDIR / | ||||||
|  | COPY --from=build /godoor/godoor /godoor | ||||||
|  |  | ||||||
|  | ENTRYPOINT ["/godoor"] | ||||||
		Reference in New Issue
	
	Block a user