updating dockerfiles and minor things

This commit is contained in:
2024-09-22 11:50:48 +02:00
parent 87d679464a
commit cf5d311731
6 changed files with 18 additions and 10 deletions

View File

@@ -2,16 +2,24 @@ package main
import (
"fmt"
"os"
"github.com/joho/godotenv"
)
func main() {
if ok := godotenv.Load("dev.env"); ok != nil {
panic(".env not found")
}
if value := os.Getenv("ENV"); value == "prod" {
if ok := godotenv.Load(".env"); ok != nil {
panic(".env not found")
}
} else {
fmt.Println("Not Produktion Enviorment fallback to dev.env")
if ok := godotenv.Load("dev.env"); ok != nil {
panic("dev.env not found")
}
}
InitDB()
err := run()