Skip to content

Conversation

@amirhmoradi
Copy link

What is this PR about?

Dokploy can start before Postgres/Redis in orchestrators like Docker Swarm, leading to a permanent stalled state where the process never recovers.

This PR adds a lightweight container entrypoint (docker-entrypoint.sh) that waits for real Postgres and Redis connectivity before starting Dokploy; using already available Node tools without introducing new installs in the image; and a Docker HEALTHCHECK that uses the existing /api/health endpoint.

No application code changes, no new runtime dependencies, opt-out via env var.

Environment variables

  • DOKPLOY_WAIT_FOR_DEPS (default: 1)
    Enable or disable waiting for PostgreSQL and Redis before starting Dokploy.

  • DOKPLOY_WAIT_TIMEOUT_SECONDS (default: 600)
    Maximum time (per dependency) to wait before exiting with error.

  • DOKPLOY_WAIT_INTERVAL_SECONDS (default: 2)
    Delay between retry attempts.

  • DATABASE_URL (required unless POSTGRES_URL is set)
    PostgreSQL connection string used for startup readiness checks.

  • POSTGRES_URL (optional)
    Override PostgreSQL URL used only for startup readiness checks.

  • REDIS_HOST (required)
    Redis hostname used by Dokploy and startup checks.

  • REDIS_PORT (default: 6379)
    Redis port used for startup checks.

  • REDIS_URL (optional)
    Override Redis connection URL used only for startup readiness checks.

Checklist

Before submitting this PR, please make sure that:

Issues related (if applicable)

None

Screenshots (if applicable)

None

…to container to allow for orchestrator restart, with proper outputs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant