mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
feat: add dockerfile
This commit is contained in:
parent
a7f31e48c2
commit
299c44cd73
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM busybox
|
||||||
|
WORKDIR /app
|
||||||
|
COPY templates/ templates/
|
||||||
|
COPY micrach ./
|
||||||
|
ENTRYPOINT ["/app/micrach"]
|
9
main.go
9
main.go
@ -9,14 +9,14 @@ import (
|
|||||||
|
|
||||||
Config "micrach/config"
|
Config "micrach/config"
|
||||||
Controllers "micrach/controllers"
|
Controllers "micrach/controllers"
|
||||||
Db "micrach/db"
|
// Db "micrach/db"
|
||||||
// Utils "micrach/utils"
|
// Utils "micrach/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
Config.Init()
|
Config.Init()
|
||||||
Db.Init()
|
// Db.Init()
|
||||||
defer Db.Pool.Close()
|
// defer Db.Pool.Close()
|
||||||
gin.SetMode(Config.App.Env)
|
gin.SetMode(Config.App.Env)
|
||||||
|
|
||||||
router := gin.Default()
|
router := gin.Default()
|
||||||
@ -27,7 +27,8 @@ func main() {
|
|||||||
router.GET("/:threadId", Controllers.GetThread)
|
router.GET("/:threadId", Controllers.GetThread)
|
||||||
router.POST("/:threadId", Controllers.UpdateThread)
|
router.POST("/:threadId", Controllers.UpdateThread)
|
||||||
|
|
||||||
|
log.Println("port", Config.App.Port, "- online")
|
||||||
log.Println("all systems nominal")
|
log.Println("all systems nominal")
|
||||||
|
|
||||||
router.Run("localhost:" + strconv.Itoa(Config.App.Port))
|
router.Run(":" + strconv.Itoa(Config.App.Port))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user