dockerize application

This commit is contained in:
2026-02-01 17:33:04 +03:00
parent e17ac03f6f
commit 0bb11c3bd7
4 changed files with 47 additions and 2 deletions

10
main.go
View File

@@ -170,7 +170,7 @@ type Config struct {
func LoadConfig(cfg *Config) error {
if err := godotenv.Load(".env"); err != nil {
return err
slog.Warn("no env file loaded", "err", err)
}
cfg.OpenAIBaseURL = os.Getenv("OPENAI_BASE_URL")
@@ -197,7 +197,13 @@ func LoadConfig(cfg *Config) error {
cfg.ChatID = chatID
cfg.SystemPrompt = os.Getenv("SYSTEM_PROMPT")
sysPromptPath := os.Getenv("SYSTEM_PROMPT_PATH")
promptBytes, err := os.ReadFile(sysPromptPath)
if err != nil {
slog.Warn("could not load system prompt", "path", sysPromptPath)
} else {
cfg.SystemPrompt = string(promptBytes)
}
return nil
}