From c5a40926e3da1ef5b6e7699735fbfd0d746e2260 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 26 May 2023 09:45:18 +0200 Subject: [PATCH] fixes --- app/Console/Kernel.php | 3 ++- app/Jobs/InstanceProxyCheckJob.php | 3 ++- bootstrap/helpers/proxy.php | 1 + docker-compose.prod.yml | 3 +++ docker/prod-ssu/Dockerfile | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 8b32d10e8..ef681cc9a 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -19,7 +19,8 @@ class Kernel extends ConsoleKernel $schedule->job(new InstanceDockerCleanupJob)->everyFiveMinutes(); $schedule->job(new InstanceAutoUpdateJob)->everyFifteenMinutes(); - $schedule->job(new InstanceProxyCheckJob)->everyMinute(); + // Disabled for now, added oom_kill_disable: true to docker-compose.yml + // $schedule->job(new InstanceProxyCheckJob)->everyMinute(); } /** diff --git a/app/Jobs/InstanceProxyCheckJob.php b/app/Jobs/InstanceProxyCheckJob.php index f42d7cff2..1de91261b 100755 --- a/app/Jobs/InstanceProxyCheckJob.php +++ b/app/Jobs/InstanceProxyCheckJob.php @@ -3,6 +3,7 @@ namespace App\Jobs; use App\Actions\Proxy\InstallProxy; +use App\Enums\ProxyTypes; use App\Models\Server; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -29,7 +30,7 @@ class InstanceProxyCheckJob implements ShouldQueue try { $container_name = 'coolify-proxy'; $configuration_path = config('coolify.proxy_config_path'); - $servers = Server::whereRelation('settings', 'is_validated', true)->get(); + $servers = Server::whereRelation('settings', 'is_validated', true)->where('extra_attributes->proxy_type', ProxyTypes::TRAEFIK_V2)->get(); foreach ($servers as $server) { $status = get_container_status(server: $server, container_id: $container_name); diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.php index 7290ac834..3b0c06973 100644 --- a/bootstrap/helpers/proxy.php +++ b/bootstrap/helpers/proxy.php @@ -27,6 +27,7 @@ if (!function_exists('getProxyConfiguration')) { "networks" => $array_of_networks->toArray(), "services" => [ "traefik" => [ + "oom_kill_disable" => true, "container_name" => "coolify-proxy", "image" => "traefik:v2.10", "restart" => "always", diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index d7944b922..07b92e4b2 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,6 +1,7 @@ version: '3.8' services: coolify: + oom_kill_disable: true image: "ghcr.io/coollabsio/coolify:${LATEST_IMAGE:-4.0.0-nightly.0}" volumes: - type: bind @@ -41,6 +42,7 @@ services: postgres: condition: service_healthy postgres: + oom_kill_disable: true volumes: - coolify-db:/var/lib/postgresql/data environment: @@ -59,6 +61,7 @@ services: retries: 5 timeout: 2s redis: + oom_kill_disable: true command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD} environment: REDIS_PASSWORD: "${REDIS_PASSWORD}" diff --git a/docker/prod-ssu/Dockerfile b/docker/prod-ssu/Dockerfile index 01c984bd2..8f3e0927c 100644 --- a/docker/prod-ssu/Dockerfile +++ b/docker/prod-ssu/Dockerfile @@ -27,4 +27,4 @@ RUN echo "alias a='php artisan'" >>/etc/bash.bashrc RUN echo "alias mfs='php artisan migrate:fresh --seed'" >>/etc/bash.bashrc RUN echo "alias cda='composer dump-autoload'" >>/etc/bash.bashrc RUN echo "alias run='./scripts/run'" >>/etc/bash.bashrc -RUN echo "alias logs='logs -f storage/logs/laravel.log'" >>/etc/bash.bashrc +RUN echo "alias logs='tail -f storage/logs/laravel.log'" >>/etc/bash.bashrc