This commit is contained in:
Andras Bacsai 2023-05-26 09:45:18 +02:00
parent 6f50f857c6
commit c5a40926e3
5 changed files with 9 additions and 3 deletions

View File

@ -19,7 +19,8 @@ class Kernel extends ConsoleKernel
$schedule->job(new InstanceDockerCleanupJob)->everyFiveMinutes(); $schedule->job(new InstanceDockerCleanupJob)->everyFiveMinutes();
$schedule->job(new InstanceAutoUpdateJob)->everyFifteenMinutes(); $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();
} }
/** /**

View File

@ -3,6 +3,7 @@
namespace App\Jobs; namespace App\Jobs;
use App\Actions\Proxy\InstallProxy; use App\Actions\Proxy\InstallProxy;
use App\Enums\ProxyTypes;
use App\Models\Server; use App\Models\Server;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
@ -29,7 +30,7 @@ class InstanceProxyCheckJob implements ShouldQueue
try { try {
$container_name = 'coolify-proxy'; $container_name = 'coolify-proxy';
$configuration_path = config('coolify.proxy_config_path'); $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) { foreach ($servers as $server) {
$status = get_container_status(server: $server, container_id: $container_name); $status = get_container_status(server: $server, container_id: $container_name);

View File

@ -27,6 +27,7 @@ if (!function_exists('getProxyConfiguration')) {
"networks" => $array_of_networks->toArray(), "networks" => $array_of_networks->toArray(),
"services" => [ "services" => [
"traefik" => [ "traefik" => [
"oom_kill_disable" => true,
"container_name" => "coolify-proxy", "container_name" => "coolify-proxy",
"image" => "traefik:v2.10", "image" => "traefik:v2.10",
"restart" => "always", "restart" => "always",

View File

@ -1,6 +1,7 @@
version: '3.8' version: '3.8'
services: services:
coolify: coolify:
oom_kill_disable: true
image: "ghcr.io/coollabsio/coolify:${LATEST_IMAGE:-4.0.0-nightly.0}" image: "ghcr.io/coollabsio/coolify:${LATEST_IMAGE:-4.0.0-nightly.0}"
volumes: volumes:
- type: bind - type: bind
@ -41,6 +42,7 @@ services:
postgres: postgres:
condition: service_healthy condition: service_healthy
postgres: postgres:
oom_kill_disable: true
volumes: volumes:
- coolify-db:/var/lib/postgresql/data - coolify-db:/var/lib/postgresql/data
environment: environment:
@ -59,6 +61,7 @@ services:
retries: 5 retries: 5
timeout: 2s timeout: 2s
redis: redis:
oom_kill_disable: true
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD} command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
environment: environment:
REDIS_PASSWORD: "${REDIS_PASSWORD}" REDIS_PASSWORD: "${REDIS_PASSWORD}"

View File

@ -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 mfs='php artisan migrate:fresh --seed'" >>/etc/bash.bashrc
RUN echo "alias cda='composer dump-autoload'" >>/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 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