Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amicale CORE
Seb
Seb API
Commits
5e487891
Verified
Commit
5e487891
authored
Dec 20, 2021
by
Maxime FRIESS
💙
Browse files
[build] Added Docker to Seb (closes
#52
)
parent
23ec87fe
Pipeline
#69123
failed with stages
in 34 seconds
Changes
6
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.dockerignore
0 → 100644
View file @
5e487891
vendor
.git
.env
\ No newline at end of file
.gitlab-ci.yml
View file @
5e487891
...
...
@@ -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
:
[]
...
...
Dockerfile
0 → 100644
View file @
5e487891
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
app/Http/Kernel.php
View file @
5e487891
...
...
@@ -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'
,
...
...
app/Services/Gateway.php
View file @
5e487891
...
...
@@ -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
=
[];
}
...
...
config/fortify.php
View file @
5e487891
...
...
@@ -89,7 +89,7 @@ return [
|
*/
'middleware'
=>
[
'
web
'
,
\
App\Http\Middleware\ForceJSON
::
class
],
'middleware'
=>
[
"
web
"
],
/*
|--------------------------------------------------------------------------
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment