Skip to content

Commit

Permalink
initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rancher-max committed Jan 3, 2020
0 parents commit 5579172
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
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"]
20 changes: 20 additions & 0 deletions main.go
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))
}

0 comments on commit 5579172

Please sign in to comment.