Fix build failures
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
/node_modules
|
/node_modules
|
||||||
|
/bootstrap/cache
|
||||||
/public/hot
|
/public/hot
|
||||||
/public/storage
|
/public/storage
|
||||||
/storage/*.key
|
/storage/*.key
|
||||||
|
|||||||
+4
-1
@@ -55,10 +55,13 @@ RUN composer install \
|
|||||||
--optimize-autoloader
|
--optimize-autoloader
|
||||||
|
|
||||||
RUN mkdir -p \
|
RUN mkdir -p \
|
||||||
|
storage/app \
|
||||||
storage/framework/cache/data \
|
storage/framework/cache/data \
|
||||||
storage/framework/sessions \
|
storage/framework/sessions \
|
||||||
storage/framework/views \
|
storage/framework/views \
|
||||||
|
storage/logs \
|
||||||
|
bootstrap/cache \
|
||||||
&& chown -R www-data:www-data storage 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
|
EXPOSE 80
|
||||||
|
|||||||
@@ -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
|
|
||||||
+27
-8
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Console;
|
namespace App\Console;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
@@ -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.
|
* Define the application's command schedule.
|
||||||
*
|
*
|
||||||
@@ -28,37 +46,38 @@ class Kernel extends ConsoleKernel
|
|||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
{
|
{
|
||||||
$this->API_URL = env('API_URL', 'https://api.nhgooi.nl/');
|
$this->API_URL = env('API_URL', 'https://api.nhgooi.nl/');
|
||||||
|
$this->API_HOST = env('API_HOST', $this->API_URL);
|
||||||
|
|
||||||
// Update latest news (3 items)
|
// Update latest news (3 items)
|
||||||
$schedule->call(function () {
|
$schedule->call(function () {
|
||||||
Storage::disk('local')->put('laatste_nieuws.json', file_get_contents($this->API_URL . 'nieuws/overzicht?pagina=1&aantal=3'));
|
$this->getFromApi('nieuws/overzicht?pagina=1&aantal=3', 'laatste_nieuws.json');
|
||||||
Storage::disk('local')->put('populair_nieuws.json', file_get_contents($this->API_URL . 'nieuws/populair'));
|
$this->getFromApi('nieuws/populair', 'populair_nieuws.json');
|
||||||
})->everyMinute();
|
})->everyMinute();
|
||||||
|
|
||||||
// Update now / later
|
// Update now / later
|
||||||
$schedule->call(function () {
|
$schedule->call(function () {
|
||||||
Storage::disk('local')->put('nu_straks.json', file_get_contents($this->API_URL . 'programma/schema/nustraks'));
|
$this->getFromApi('programma/schema/nustraks', 'nu_straks.json');
|
||||||
Storage::disk('local')->put('zojuist.json', file_get_contents($this->API_URL . 'programma/schema/recent'));
|
$this->getFromApi('programma/schema/recent', 'zojuist.json');
|
||||||
})->everyMinute();
|
})->everyMinute();
|
||||||
|
|
||||||
// Update latest podcasts (6 items)
|
// Update latest podcasts (6 items)
|
||||||
$schedule->call(function () {
|
$schedule->call(function () {
|
||||||
Storage::disk('local')->put('laatste_podcasts.json', file_get_contents($this->API_URL . 'podcast/overzicht?pagina=1&aantal=6'));
|
$this->getFromApi('podcast/overzicht?pagina=1&aantal=6', 'laatste_podcasts.json');
|
||||||
})->everyMinute();
|
})->everyMinute();
|
||||||
|
|
||||||
// Update calendar items
|
// Update calendar items
|
||||||
$schedule->call(function () {
|
$schedule->call(function () {
|
||||||
Storage::disk('local')->put('regioagenda.json', file_get_contents($this->API_URL . 'agenda/overzicht'));
|
$this->getFromApi('agenda/overzicht', 'regioagenda.json');
|
||||||
})->everyMinute();
|
})->everyMinute();
|
||||||
|
|
||||||
// Update blogs
|
// Update blogs
|
||||||
$schedule->call(function () {
|
$schedule->call(function () {
|
||||||
Storage::disk('local')->put('blogs.json', file_get_contents($this->API_URL . 'blog/overzicht'));
|
$this->getFromApi('blog/overzicht', 'blogs.json');
|
||||||
})->everyMinute();
|
})->everyMinute();
|
||||||
|
|
||||||
// Update featured images
|
// Update featured images
|
||||||
$schedule->call(function () {
|
$schedule->call(function () {
|
||||||
Storage::disk('local')->put('beelden.json', file_get_contents($this->API_URL . 'beelden/overzicht'));
|
$this->getFromApi('beelden/overzicht', 'beelden.json');
|
||||||
})->everyMinute();
|
})->everyMinute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user