added docker compose to run everything in one go

This commit is contained in:
2024-05-12 15:29:36 +01:00
parent 0c0d16c846
commit 516d1d7634
18 changed files with 184 additions and 91 deletions

15
main.go
View File

@@ -15,25 +15,18 @@ import (
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/utils"
)
const (
host = "localhost"
port = 5432
user = "postgres"
password = "verysafepassword"
dbname = "aistuff"
)
func main() {
config := LoadConfig()
log.Info("Config loaded!", "config", config)
psqlInfo := fmt.Sprintf("host=%s port=%d user=%s "+
"password=%s dbname=%s sslmode=disable",
host, port, user, password, dbname)
config.DbInfo.Host, config.DbInfo.Port, config.DbInfo.User, config.DbInfo.Password, config.DbInfo.Dbname)
db := db.StartUp(psqlInfo)
defer db.Close()
config := LoadConfig()
log.Info("Config loaded!", "config", config)
config.GenerateToken(db)
//TODO check if file structure exists to save data