Skip to content

Commit

Permalink
feat: optional install directory
Browse files Browse the repository at this point in the history
  • Loading branch information
LEstradioto committed Dec 18, 2024
1 parent 0feac8c commit 5d36095
Show file tree
Hide file tree
Showing 12 changed files with 576 additions and 85 deletions.
5 changes: 5 additions & 0 deletions app/Actions/Server/StartSentinel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ public function handle(Server $server, bool $restart = false, ?string $latestVer
$token = data_get($server, 'settings.sentinel_token');
$endpoint = data_get($server, 'settings.sentinel_custom_url');
$debug = data_get($server, 'settings.is_sentinel_debug_enabled');
<<<<<<< Updated upstream
$mountDir = '/data/coolify/sentinel';
=======
$base_path = config('coolify.base_config_path');
$mountDir = "$base_path/sentinel";
>>>>>>> Stashed changes
$image = "ghcr.io/coollabsio/sentinel:$version";
if (! $endpoint) {
throw new \Exception('You should set FQDN in Instance Settings.');
Expand Down
14 changes: 12 additions & 2 deletions app/Actions/Server/UpdateCoolify.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,19 @@ public function handle($manual_update = false)
$this->currentVersion = config('constants.coolify.version');
if (! $manual_update) {
if (! $settings->is_auto_update_enabled) {
<<<<<<< Updated upstream
return;
}
if ($this->latestVersion === $this->currentVersion) {
return;
}
=======
return;
}
if ($this->latestVersion === $this->currentVersion) {
return;
}
>>>>>>> Stashed changes
if (version_compare($this->latestVersion, $this->currentVersion, '<')) {
return;
}
Expand All @@ -54,9 +62,11 @@ private function update()

instant_remote_process(["docker pull -q ghcr.io/coollabsio/coolify:{$this->latestVersion}"], $this->server, false);

$base_path = config('coolify.base_config_path');

remote_process([
'curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh',
"bash /data/coolify/source/upgrade.sh $this->latestVersion",
"curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o {$base_path}/source/upgrade.sh",
"bash {$base_path}/source/upgrade.sh $this->latestVersion",
], $this->server);
}
}
2 changes: 1 addition & 1 deletion bootstrap/helpers/shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

function base_configuration_dir(): string
{
return '/data/coolify';
return config('coolify.base_config_path') ?? '/data/coolify';
}
function application_configuration_dir(): string
{
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ services:
container_name: coolify-testing-host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- dev_coolify_data:/data/coolify
- dev_backups_data:/data/coolify/backups
- dev_postgres_data:/data/coolify/_volumes/database
- dev_redis_data:/data/coolify/_volumes/redis
- dev_minio_data:/data/coolify/_volumes/minio
- dev_coolify_data:${BASE_CONFIG_PATH:-/data/coolify}
- dev_backups_data:${BASE_CONFIG_PATH:-/data/coolify}/backups
- dev_postgres_data:${BASE_CONFIG_PATH:-/data/coolify}/_volumes/database
- dev_redis_data:${BASE_CONFIG_PATH:-/data/coolify}/_volumes/redis
- dev_minio_data:${BASE_CONFIG_PATH:-/data/coolify}/_volumes/minio
networks:
- coolify
mailpit:
Expand Down
16 changes: 8 additions & 8 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ services:
image: "ghcr.io/coollabsio/coolify:${LATEST_IMAGE:-latest}"
volumes:
- type: bind
source: /data/coolify/source/.env
source: ${BASE_CONFIG_PATH:-/data/coolify}/source/.env
target: /var/www/html/.env
read_only: true
- /data/coolify/ssh:/var/www/html/storage/app/ssh
- /data/coolify/applications:/var/www/html/storage/app/applications
- /data/coolify/databases:/var/www/html/storage/app/databases
- /data/coolify/services:/var/www/html/storage/app/services
- /data/coolify/backups:/var/www/html/storage/app/backups
- /data/coolify/webhooks-during-maintenance:/var/www/html/storage/app/webhooks-during-maintenance
- ${BASE_CONFIG_PATH:-/data/coolify}/ssh:/var/www/html/storage/app/ssh
- ${BASE_CONFIG_PATH:-/data/coolify}/applications:/var/www/html/storage/app/applications
- ${BASE_CONFIG_PATH:-/data/coolify}/databases:/var/www/html/storage/app/databases
- ${BASE_CONFIG_PATH:-/data/coolify}/services:/var/www/html/storage/app/services
- ${BASE_CONFIG_PATH:-/data/coolify}/backups:/var/www/html/storage/app/backups
- ${BASE_CONFIG_PATH:-/data/coolify}/webhooks-during-maintenance:/var/www/html/storage/app/webhooks-during-maintenance
environment:
- APP_ENV=production
- APP_NAME
Expand Down Expand Up @@ -98,7 +98,7 @@ services:
- "${SOKETI_PORT:-6001}:6001"
- "6002:6002"
volumes:
- /data/coolify/ssh:/var/www/html/storage/app/ssh
- ${BASE_CONFIG_PATH:-/data/coolify}/ssh:/var/www/html/storage/app/ssh
environment:
APP_NAME: "${APP_NAME:-Coolify}"
SOKETI_DEBUG: "${SOKETI_DEBUG:-false}"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
container_name: coolify-testing-host
volumes:
- //var/run/docker.sock://var/run/docker.sock
- ./:/data/coolify
- ./:${BASE_CONFIG_PATH:-/data/coolify}
coolify:
image: "ghcr.io/coollabsio/coolify:latest"
pull_policy: always
Expand Down
16 changes: 8 additions & 8 deletions other/nightly/docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ services:
image: "ghcr.io/coollabsio/coolify:${LATEST_IMAGE:-latest}"
volumes:
- type: bind
source: /data/coolify/source/.env
source: ${BASE_CONFIG_PATH:-/data/coolify}/source/.env
target: /var/www/html/.env
read_only: true
- /data/coolify/ssh:/var/www/html/storage/app/ssh
- /data/coolify/applications:/var/www/html/storage/app/applications
- /data/coolify/databases:/var/www/html/storage/app/databases
- /data/coolify/services:/var/www/html/storage/app/services
- /data/coolify/backups:/var/www/html/storage/app/backups
- /data/coolify/webhooks-during-maintenance:/var/www/html/storage/app/webhooks-during-maintenance
- ${BASE_CONFIG_PATH:-/data/coolify}/ssh:/var/www/html/storage/app/ssh
- ${BASE_CONFIG_PATH:-/data/coolify}/applications:/var/www/html/storage/app/applications
- ${BASE_CONFIG_PATH:-/data/coolify}/databases:/var/www/html/storage/app/databases
- ${BASE_CONFIG_PATH:-/data/coolify}/services:/var/www/html/storage/app/services
- ${BASE_CONFIG_PATH:-/data/coolify}/backups:/var/www/html/storage/app/backups
- ${BASE_CONFIG_PATH:-/data/coolify}/webhooks-during-maintenance:/var/www/html/storage/app/webhooks-during-maintenance
environment:
- APP_ENV=production
- APP_NAME
Expand Down Expand Up @@ -98,7 +98,7 @@ services:
- "${SOKETI_PORT:-6001}:6001"
- "6002:6002"
volumes:
- /data/coolify/ssh:/var/www/html/storage/app/ssh
- ${BASE_CONFIG_PATH:-/data/coolify}/ssh:/var/www/html/storage/app/ssh
environment:
APP_NAME: "${APP_NAME:-Coolify}"
SOKETI_DEBUG: "${SOKETI_DEBUG:-false}"
Expand Down
2 changes: 1 addition & 1 deletion other/nightly/docker-compose.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
container_name: coolify-testing-host
volumes:
- //var/run/docker.sock://var/run/docker.sock
- ./:/data/coolify
- ./:${BASE_CONFIG_PATH:-/data/coolify}
coolify:
image: "ghcr.io/coollabsio/coolify:latest"
pull_policy: always
Expand Down
Loading

0 comments on commit 5d36095

Please sign in to comment.