Skip to content

Commit

Permalink
Implement the first assignment in go
Browse files Browse the repository at this point in the history
[refs #279da99b2959]
  • Loading branch information
jfahrer committed May 5, 2018
1 parent c6d01ba commit 3d13c9e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
9 changes: 9 additions & 0 deletions developing/examples/webapp/golang/Dockerfile
@@ -0,0 +1,9 @@
FROM golang:1.9.2-alpine

WORKDIR /go/src/app

COPY app.go .

RUN go build app.go

CMD ["./app"]
14 changes: 14 additions & 0 deletions developing/examples/webapp/golang/app.go
@@ -0,0 +1,14 @@
package main

import (
"net/http"
)
func helloWorld(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello World!"))
}

func main() {
http.HandleFunc("/", helloWorld)
http.ListenAndServe(":9494", nil)
}

12 changes: 12 additions & 0 deletions developing/examples/webapp/golang/docker-compose.yml
@@ -0,0 +1,12 @@
version: '3.3'

services:
app:
image: jfahrer/webapp-golang:v1
build:
context: .
volumes:
- .:/go/src/app
ports:
- 9494:9494
command: ["go", "run", "app.go"]

0 comments on commit 3d13c9e

Please sign in to comment.