feat: add install script and fix Docker environment config
- Add install.sh for one-line installation (Linux/macOS) - Detects local Ollama and lets user choose system vs Docker - Generates docker-compose.override.yml for system Ollama mode - Supports --update and --uninstall flags - Fix backend not reading OLLAMA_URL from environment variable - Add getEnvOrDefault() helper for PORT, DB_PATH, OLLAMA_URL - Update Dockerfile to use env vars instead of hardcoded flags - Update README with new Quick Start instructions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,11 +17,18 @@ import (
|
||||
"vessel-backend/internal/database"
|
||||
)
|
||||
|
||||
func getEnvOrDefault(key, defaultValue string) string {
|
||||
if value := os.Getenv(key); value != "" {
|
||||
return value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
||||
|
||||
func main() {
|
||||
var (
|
||||
port = flag.String("port", "8080", "Server port")
|
||||
dbPath = flag.String("db", "./data/vessel.db", "Database file path")
|
||||
ollamaURL = flag.String("ollama-url", "http://localhost:11434", "Ollama API URL")
|
||||
port = flag.String("port", getEnvOrDefault("PORT", "8080"), "Server port")
|
||||
dbPath = flag.String("db", getEnvOrDefault("DB_PATH", "./data/vessel.db"), "Database file path")
|
||||
ollamaURL = flag.String("ollama-url", getEnvOrDefault("OLLAMA_URL", "http://localhost:11434"), "Ollama API URL")
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user