-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5579172
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM golang:1.12.1-alpine3.9 | ||
ENV GOPATH="/go" | ||
RUN ["mkdir", "-p", "/go/src/github.com/rancher/demo"] | ||
COPY * /go/src/github.com/rancher/demo/ | ||
WORKDIR /go/src/github.com/rancher/demo | ||
RUN ["go", "build", "-o", "demo"] | ||
CMD ["./demo"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"net/http" | ||
"time" | ||
) | ||
|
||
func handler(w http.ResponseWriter, r *http.Request) { | ||
// Arbitrary sleep so that we can demonstrate autoscaler | ||
log.Println("Basic logging -- request received") | ||
time.Sleep(51 * time.Millisecond) | ||
fmt.Fprintln(w, "Stampede 2020 Demo: Initial Commit") | ||
} | ||
|
||
func main() { | ||
http.HandleFunc("/", handler) | ||
log.Fatal(http.ListenAndServe(":8080", nil)) | ||
} |