-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wrote memorycell Dockerfile, memorycell server, create container
Git issue references: Gamelan music currently playing: Gendhing Prabu Mataram Co-authored-by: c <[email protected]> Co-authored-by: Mouse Reeve <[email protected]>
- Loading branch information
1 parent
6c23c8b
commit 4a81098
Showing
5 changed files
with
95 additions
and
3 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,13 @@ | ||
FROM golang:1.9-alpine as memorycell | ||
|
||
WORKDIR /go/src/github.com/connorwalsh/dockerlang | ||
COPY . . | ||
# no need to go get since we are vendoring all our deps | ||
RUN cd ./memorycell && ls && go build | ||
|
||
FROM alpine | ||
|
||
WORKDIR /usr/bin | ||
COPY --from=memorycell /go/src/github.com/connorwalsh/dockerlang/memorycell/memorycell . | ||
|
||
CMD ["/usr/bin/memorycell"] |
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
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
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,43 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"net/http" | ||
"os" | ||
|
||
"github.com/connorwalsh/dockerlang" | ||
) | ||
|
||
var ( | ||
COMPUTATION_TYPE string | ||
COMPUTATION_VALUE string | ||
) | ||
|
||
func main() { | ||
|
||
// get the computation type and value | ||
COMPUTATION_TYPE = os.Getenv(dockerlang.COMPUTATION_TYPE_ENV_VAR) | ||
COMPUTATION_VALUE = os.Getenv(dockerlang.COMPUTATION_VALUE_ENV_VAR) | ||
|
||
http.HandleFunc("/", ExecHandler) | ||
http.HandleFunc("/kill", KillHandler) | ||
|
||
fmt.Printf( | ||
"Dockerlang Memory Ready for Use (%s %s)...\n", | ||
COMPUTATION_TYPE, | ||
COMPUTATION_VALUE, | ||
) | ||
log.Fatal(http.ListenAndServe( | ||
fmt.Sprintf(":%s", dockerlang.MEMORY_PORT), | ||
nil, | ||
)) | ||
} | ||
|
||
func ExecHandler(w http.ResponseWriter, r *http.Request) { | ||
fmt.Println("EXEC SOMETHING") | ||
} | ||
|
||
func KillHandler(w http.ResponseWriter, r *http.Request) { | ||
fmt.Println("KILL ME") | ||
} |
Binary file not shown.