diff options
-rw-r--r-- | Dockerfile | 10 | ||||
-rw-r--r-- | docker-compose.yml | 7 | ||||
-rw-r--r-- | main.go | 20 |
3 files changed, 37 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2396314 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:latest + +WORKDIR /home + +COPY main.go /home/main.go + +RUN ["go", "get", "github.com/gorilla/mux"] +RUN ["go", "get", "git.darknebu.la/GalaxySimulator/structs"] + +ENTRYPOINT ["go", "run", "/home/main.go"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b7a8e13 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3' + +services: + manager: + build: . + ports: + - "80:80" \ No newline at end of file diff --git a/main.go b/main.go new file mode 100644 index 0000000..4088fb1 --- /dev/null +++ b/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "log" + "net/http" + + "github.com/gorilla/mux" +) + +func indexHandler(w http.ResponseWriter, r *http.Request) { + _, _ = fmt.Fprintln(w, "Hello World\nThis is the manager managing all the processes") +} + +func main() { + router := mux.NewRouter() + + router.HandleFunc("/", indexHandler).Methods("GET") + log.Fatal(http.ListenAndServe(":80", router)) +} |