mirror of
https://gitea.com/action-examples/Go.git
synced 2026-03-27 08:30:06 +00:00
feat: implement example-go service with Docker support
- Add a new Makefile with build, docker-build, test, and clean targets, including cross-compilation support for Linux AMD64 and ARM64. - Introduce a new Go executable `example-go` with a basic HTTP server setup. - Create a new Dockerfile for an Alpine-based container including the `example-go` binary, with metadata labels and an entrypoint. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
13
cmd/example-go/main.go
Normal file
13
cmd/example-go/main.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"gitea.com/action-examples/go/router"
|
||||
)
|
||||
|
||||
func main() {
|
||||
r := router.New()
|
||||
// listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
|
||||
if err := r.Run(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user