core/security-governance-core/internal/config/config.go
Tiago Yamamoto a52bd4519d refactor: optimize Dockerfiles and documentation for core services
- Use Google Distroless images for all services (Go & Node.js).
- Standardize documentation with [PROJECT-NAME].md.
- Add .dockerignore and .gitignore to all projects.
- Remove docker-compose.yml in favor of docker run instructions.
- Fix Go version and dependency issues in observability, repo-integrations, and security-governance.
- Add Podman support (fully qualified image names).
- Update Dashboard to use Node.js static server for Distroless compatibility.
2025-12-30 13:22:34 -03:00

35 lines
580 B
Go

package config
import (
"log"
"os"
"github.com/joho/godotenv"
)
type Config struct {
DatabaseURL string
Port string
}
func Load() *Config {
err := godotenv.Load()
if err != nil {
log.Println("No .env file found, using environment variables")
}
return &Config{
DatabaseURL: getEnv("DATABASE_URL", ""),
Port: getEnv("PORT", "8080"),
}
}
func getEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
if fallback == "" {
log.Fatalf("FATAL: Environment variable %s is not set.", key)
}
return fallback
}