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:
Bo-Yi Wu
2024-02-20 09:51:50 +08:00
parent 9d1d40c08a
commit f171daa81a
3 changed files with 121 additions and 0 deletions

13
cmd/example-go/main.go Normal file
View 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)
}
}