Skip to content

Add predefined environment variables (DOKPLOY_FQDN, DOKPLOY_URL, etc.) #3829

@Asamsig

Description

@Asamsig

What problem will this feature address?

Currently, users must manually configure environment variables like NEXTAUTH_URL, when their application needs to know its own domain. This is error-prone as users must duplicate the domain configuration in multiple places, and it's easy to forget to update these when changing domains.

Describe the solution you'd like

Add automatic predefined environment variables for example:

Variable Description
DOKPLOY_FQDN Domain host (e.g., example.com)
DOKPLOY_URL Full URL with protocol (e.g., https://example.com)
DOKPLOY_PORT Port from domain config
DOKPLOY_BRANCH Git branch being deployed
DOKPLOY_COMMIT_SHA Git commit SHA
DOKPLOY_IMAGE_TAG Docker image tag (for docker source apps)
DOKPLOY_IMAGE_DIGEST Docker image digest
DOKPLOY_APPLICATION_ID Application ID
DOKPLOY_CONTAINER_NAME Container/App name

These would be available at both build-time and runtime.

Implementation includes:

  1. Add a primary switch to domains, this sets which domain to use for the environment variables
  2. Should all domain names be made available somehow?

Describe alternatives you've considered

Manually configure these in environment variables (current approach)

Additional context

No response

Will you send a PR to implement it?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions