Fix Dokploy Bad Gateway: drop required .env and add app healthcheck.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-29 04:10:37 +03:00
co-authored by Cursor
parent 7b77d84f68
commit 6510de0214
4 changed files with 48 additions and 15 deletions
+7 -1
View File
@@ -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"),