From 299c44cd730d46f517fe584be696b5817940304a Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Sat, 28 Aug 2021 19:30:14 +0300 Subject: [PATCH] feat: add dockerfile --- Dockerfile | 5 +++++ main.go | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5d532fb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM busybox +WORKDIR /app +COPY templates/ templates/ +COPY micrach ./ +ENTRYPOINT ["/app/micrach"] \ No newline at end of file diff --git a/main.go b/main.go index 861d2dd..160cda1 100644 --- a/main.go +++ b/main.go @@ -9,14 +9,14 @@ import ( Config "micrach/config" Controllers "micrach/controllers" - Db "micrach/db" + // Db "micrach/db" // Utils "micrach/utils" ) func main() { Config.Init() - Db.Init() - defer Db.Pool.Close() + // Db.Init() + // defer Db.Pool.Close() gin.SetMode(Config.App.Env) router := gin.Default() @@ -27,7 +27,8 @@ func main() { router.GET("/:threadId", Controllers.GetThread) router.POST("/:threadId", Controllers.UpdateThread) + log.Println("port", Config.App.Port, "- online") log.Println("all systems nominal") - router.Run("localhost:" + strconv.Itoa(Config.App.Port)) + router.Run(":" + strconv.Itoa(Config.App.Port)) }