Skip to content

Conversation

@duaneadam
Copy link
Contributor

@duaneadam duaneadam commented Dec 27, 2025

Changes

Add a button to load .env.example from the Git source (GitHub). This only works for resources that are applications.

The Thought Process

Why load from GitHub instead of loading from Coolify itself? A few reasons..

Doing the alternative requires the app to be deployed first. Coolify fetches the app during deploy process.

  1. For new apps: You add env variables during the setup of your app, which means the app is not deployed on Coolify yet (it fetches after first deploy).
  2. For existing apps: Similar case, you'd want to load new env variable before you deploy. Else, build will fail/throw errors (e.g: you have something like T3 Env).

Demo

Loading The Env Variables For The First Time

In this demo: I will be using the new app that I added via the seed data and then show me loading its .env.example via the new button.

load_dotenv_example

Loading Existing Env Variables

readd_dotenv_example

Misc

In the demo, there is a new application as part of the seed data. I did not include it, but if the core devs think it is good to have, let me know. Either way, just add the below to database/seeders/ApplicationSeeder.php.

Laraval has a pretty long .env.example, I thought it'd make a good example.

Application::create([
    'uuid' => 'laravel-env-example',
    'name' => 'Laravel Example (has .env.example)',
    'fqdn' => 'http://laravel.127.0.0.1.sslip.io',
    'git_repository' => 'laravel/laravel',
    'git_branch' => '11.x',
    'build_pack' => 'nixpacks',
    'ports_exposes' => '8000',
    'environment_id' => 1,
    'destination_id' => 0,
    'destination_type' => StandaloneDocker::class,
    'source_id' => 0,
    'source_type' => GithubApp::class,
]);

@duaneadam duaneadam marked this pull request as ready for review December 27, 2025 12:17
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