Skip to content
Snippets Groups Projects
Unverified Commit 5e487891 authored by Maxime FRIESS's avatar Maxime FRIESS :blue_heart:
Browse files

[build] Added Docker to Seb (closes #52)

parent 23ec87fe
Branches stats
No related merge requests found
Pipeline #69123 failed with stages
in 34 seconds
vendor
.git
.env
\ No newline at end of file
......@@ -16,21 +16,6 @@ composer:
- vendor/
- .env
npm:
stage: build
cache:
key: ${CI_COMMIT_REF_SLUG}-npm
paths:
- node_modules/
script:
- yarn install
- yarn run production
artifacts:
expire_in: 1 month
paths:
- public/css/
- public/js/
codestyle:
stage: test
dependencies: []
......
FROM php:8.1-fpm
# Add composer.lock and composer.json into the working directory
ADD composer.lock composer.json /seb/
# Set working directory
WORKDIR /seb/
# Install dependencies for the operating system software
RUN apt-get update && apt-get install -y \
build-essential \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
libzip-dev \
unzip \
git \
libonig-dev \
curl
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install extensions for php
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install gd
# Install composer (php package manager)
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Add existing application directory contents to the working directory
ADD . /seb
# Assign permissions of the working directory to the www-data user
RUN chown -R www-data:www-data \
/seb/storage \
/seb/bootstrap/cache
# Install dependencies
RUN composer install
# Expose port 9000 and start php-fpm server (for FastCGI Process Manager)
# EXPOSE 9000
# CMD ["php-fpm"]
# Export port 9000 and start php artisan serve
EXPOSE 8000
CMD php artisan serve --host=0.0.0.0 --port=8000
\ No newline at end of file
......@@ -31,6 +31,14 @@ class Kernel extends HttpKernel
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\Locale::class,
],
'api' => [
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
......
......@@ -13,11 +13,11 @@ class Gateway
private array $models;
public function __construct(bool $enabled, string $url, string $key)
public function __construct(?bool $enabled, ?string $url, ?string $key)
{
$this->enabled = $enabled;
$this->url = $url;
$this->key = $key;
$this->enabled = $enabled ?? false;
$this->url = $url ?? "";
$this->key = $key ?? "";
$this->models = [];
}
......
......@@ -89,7 +89,7 @@ return [
|
*/
'middleware' => ['web', \App\Http\Middleware\ForceJSON::class],
'middleware' => ["web"],
/*
|--------------------------------------------------------------------------
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment