Fix Dokploy Bad Gateway: drop required .env and add app healthcheck.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,8 +25,14 @@ type Config struct {
|
||||
func Load() (*Config, error) {
|
||||
_ = godotenv.Load()
|
||||
|
||||
// Dokploy / PaaS often set PORT; prefer APP_PORT, then PORT.
|
||||
port := getEnv("APP_PORT", "")
|
||||
if port == "" {
|
||||
port = getEnv("PORT", "8080")
|
||||
}
|
||||
|
||||
cfg := &Config{
|
||||
Port: getEnv("APP_PORT", "8080"),
|
||||
Port: port,
|
||||
Secret: getEnv("APP_SECRET", "dev-secret-change-me"),
|
||||
Env: getEnv("APP_ENV", "development"),
|
||||
DatabaseURL: os.Getenv("DATABASE_URL"),
|
||||
|
||||
Reference in New Issue
Block a user