Fix build failures

This commit is contained in:
root
2026-08-18 08:27:25 -01:00
parent fed5f8c44d
commit 8125895538
4 changed files with 58 additions and 73 deletions
+1
View File
@@ -1,4 +1,5 @@
/node_modules
/bootstrap/cache
/public/hot
/public/storage
/storage/*.key
+4 -1
View File
@@ -55,10 +55,13 @@ RUN composer install \
--optimize-autoloader
RUN mkdir -p \
storage/app \
storage/framework/cache/data \
storage/framework/sessions \
storage/framework/views \
storage/logs \
bootstrap/cache \
&& chown -R www-data:www-data storage bootstrap/cache \
&& chmod -R ug+rwx storage bootstrap/cache
&& chmod -R ug+rwX storage bootstrap/cache
EXPOSE 80
-38
View File
@@ -1,38 +0,0 @@
FROM php:8.2-apache
RUN apt-get update \
&& apt-get -y install \
g++ \
libcurl4-gnutls-dev \
libxml2-dev \
libxslt-dev \
libzip-dev \
zlib1g-dev \
msmtp \
unzip \
git \
ssl-cert \
locales \
--no-install-recommends \
&& docker-php-ext-install pdo pdo_mysql mysqli xsl xml zip opcache \
&& a2enmod rewrite ssl proxy proxy_http headers \
&& apt-get purge -y g++ \
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Update the default apache site with the config we created.
ADD docker/apache.dev.conf /etc/apache2/sites-enabled/000-default.conf
WORKDIR /var/www/html
COPY . /var/www/html
RUN mkdir -p storage/framework/{sessions,views,cache,cache/data} && \
chown -R www-data:www-data storage/framework && \
chmod -R 775 storage
# RUN php artisan cache:clear && \
# php artisan config:clear && \
# php artisan view:clear
+53 -34
View File
@@ -2,13 +2,15 @@
namespace App\Console;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
private $API_URL;
private $API_URL;
/**
* The Artisan commands provided by your application.
@@ -19,6 +21,22 @@ class Kernel extends ConsoleKernel
//
];
private function getFromApi($url, $file) {
$response = Http::connectTimeout(5)
->timeout(15)
->withHeaders([
'Host' => $this->API_HOST
])
->get($this->API_URL . $url);
if ($response->successful()) {
Storage::disk('local')->put(
$file,
$response->body()
);
}
}
/**
* Define the application's command schedule.
*
@@ -27,39 +45,40 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$this->API_URL = env('API_URL', 'https://api.nhgooi.nl/');
// Update latest news (3 items)
$schedule->call(function() {
Storage::disk('local')->put('laatste_nieuws.json', file_get_contents($this->API_URL . 'nieuws/overzicht?pagina=1&aantal=3'));
Storage::disk('local')->put('populair_nieuws.json', file_get_contents($this->API_URL . 'nieuws/populair'));
})->everyMinute();
// Update now / later
$schedule->call(function() {
Storage::disk('local')->put('nu_straks.json', file_get_contents($this->API_URL . 'programma/schema/nustraks'));
Storage::disk('local')->put('zojuist.json', file_get_contents($this->API_URL . 'programma/schema/recent'));
})->everyMinute();
// Update latest podcasts (6 items)
$schedule->call(function() {
Storage::disk('local')->put('laatste_podcasts.json', file_get_contents($this->API_URL . 'podcast/overzicht?pagina=1&aantal=6'));
})->everyMinute();
// Update calendar items
$schedule->call(function() {
Storage::disk('local')->put('regioagenda.json', file_get_contents($this->API_URL . 'agenda/overzicht'));
})->everyMinute();
// Update blogs
$schedule->call(function() {
Storage::disk('local')->put('blogs.json', file_get_contents($this->API_URL . 'blog/overzicht'));
})->everyMinute();
// Update featured images
$schedule->call(function() {
Storage::disk('local')->put('beelden.json', file_get_contents($this->API_URL . 'beelden/overzicht'));
})->everyMinute();
$this->API_URL = env('API_URL', 'https://api.nhgooi.nl/');
$this->API_HOST = env('API_HOST', $this->API_URL);
// Update latest news (3 items)
$schedule->call(function () {
$this->getFromApi('nieuws/overzicht?pagina=1&aantal=3', 'laatste_nieuws.json');
$this->getFromApi('nieuws/populair', 'populair_nieuws.json');
})->everyMinute();
// Update now / later
$schedule->call(function () {
$this->getFromApi('programma/schema/nustraks', 'nu_straks.json');
$this->getFromApi('programma/schema/recent', 'zojuist.json');
})->everyMinute();
// Update latest podcasts (6 items)
$schedule->call(function () {
$this->getFromApi('podcast/overzicht?pagina=1&aantal=6', 'laatste_podcasts.json');
})->everyMinute();
// Update calendar items
$schedule->call(function () {
$this->getFromApi('agenda/overzicht', 'regioagenda.json');
})->everyMinute();
// Update blogs
$schedule->call(function () {
$this->getFromApi('blog/overzicht', 'blogs.json');
})->everyMinute();
// Update featured images
$schedule->call(function () {
$this->getFromApi('beelden/overzicht', 'beelden.json');
})->everyMinute();
}
/**