Compare commits

..

12 Commits

Author SHA1 Message Date
Ronald A. Richardson
e8bc17c5b9 Update console with new Dashboard, Added Changelog, Added new SocketService for handling socket connections and listening, fleetbase-extensions-indexer now extracts custom fleetbase key from extension packages, <Layout::Sidebar /> is now collapsible, <Layout::Header /> can now accept custom nav items from argument, Patched <ModelSelect /> component to properly accept and handle customSearchEndpoint arg 2023-06-13 23:57:34 +08:00
Ronald A. Richardson
9b938e84c5 updated nginx config for timeout and logging 2023-06-11 12:15:05 +08:00
Ronald A. Richardson
672ac85d7d updated docker-compose.yml 2023-06-11 11:55:03 +08:00
Ronald A. Richardson
9decae6e26 set target as app-dev for application 2023-06-11 11:33:11 +08:00
Ronald A. Richardson
6d4d037d2f removed all shared volumes from docker environment - only use for dev, drop httpd container 2023-06-11 11:01:36 +08:00
Ronald A. Richardson
3969473b99 updated Dockerfile to handle permission issues and patch composer install and dump, as well as dependency updates for api 2023-06-09 16:08:38 +08:00
Ronald A. Richardson
cb23dda979 updated api to use fleetbase/core-api#v1.0.6-alpha 2023-06-09 12:39:23 +08:00
Ronald A. Richardson
8a2ce65763 updated fleetbase/core-api to v1.0.5-alpha to add server IP as CORS origin 2023-06-09 12:08:50 +08:00
Ronald A. Richardson
b4c4012557 updated console to v0.0.7 which includes window.crypto.randomUUID polyfill patch 2023-06-09 11:22:09 +08:00
Ronald A. Richardson
8683f1b0ca Admin System Configuration v1 ready 2023-06-08 18:43:34 +08:00
Ronald A. Richardson
80774383bc bump console to v0.0.5 for firefox patches 2023-06-07 21:22:08 +08:00
Ronald A. Richardson
acf3c66c9f patch Dockerfile 2023-06-07 19:15:37 +08:00
19 changed files with 437 additions and 123 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
# These are supported funding model platforms
github: fleetbase

View File

@@ -0,0 +1,2 @@
#!/bin/bash
mv composer.json composer.prod.json && mv composer.dev.json composer.json && composer install && mv composer.json composer.dev.json && mv composer.prod.json composer.json

108
api/composer.dev.json Normal file
View File

@@ -0,0 +1,108 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fleetbase/core-api": "^1.0.9-alpha",
"fleetbase/fleetops-api": "^1.0.3-alpha",
"fleetbase/storefront-api": "^1.0.3-alpha",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"league/flysystem-aws-s3-v3": "^1.0",
"maatwebsite/excel": "^3.1",
"phpoffice/phpspreadsheet": "^1.28",
"predis/predis": "^2.1",
"psr/http-factory-implementation": "*",
"textalk/websocket": "^1.6"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"kitloong/laravel-migrations-generator": "^6.10",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
},
"repositories": [
{
"type": "path",
"url": "../packages/core-api"
},
{
"type": "path",
"url": "../packages/fleetops-api"
},
{
"type": "path",
"url": "../packages/storefront-api"
}
],
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"clear-logs": [
"rm -rf storage/logs/*.log",
"composer dump-autoload",
"chmod -R 777 storage",
"chmod -R 777 bootstrap/cache",
"chmod -R 777 resources"
],
"clean-logs": [
"composer run-script clear-logs"
],
"dock": [
"docker exec -it fleetbase_os_application_1 /usr/bin/tmux -u new"
],
"dock-server": [
"docker exec -it fleetbase_os_httpd_1 /bin/sh"
],
"tunnel": [
"ngrok http --region=ap --hostname=fleetbase.ap.ngrok.io 8000"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"php-http/discovery": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
}

View File

@@ -6,16 +6,18 @@
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fleetbase/core-api": "^1.0.3-alpha",
"fleetbase/fleetops-api": "^1.0.1-alpha",
"fleetbase/storefront-api": "^1.0.1-alpha",
"fleetbase/core-api": "^1.0.9-alpha",
"fleetbase/fleetops-api": "^1.0.3-alpha",
"fleetbase/storefront-api": "^1.0.3-alpha",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"league/flysystem-aws-s3-v3": "^1.0",
"maatwebsite/excel": "^3.1",
"phpoffice/phpspreadsheet": "^1.28",
"predis/predis": "^2.1",
"psr/http-factory-implementation": "*",
"textalk/websocket": "^1.6"
},

270
api/composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e39edfd17e56ba33f60f895cbad0f59a",
"content-hash": "9e942b73a0335025ddaace9e4a68b836",
"packages": [
{
"name": "aloha/twilio",
@@ -192,16 +192,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.271.7",
"version": "3.272.2",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "d0fe1af38ef521e419004e5f990ceb8e0b2b001d"
"reference": "0c4cba74c79f9b44393c27721fa1fa9138c95387"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d0fe1af38ef521e419004e5f990ceb8e0b2b001d",
"reference": "d0fe1af38ef521e419004e5f990ceb8e0b2b001d",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0c4cba74c79f9b44393c27721fa1fa9138c95387",
"reference": "0c4cba74c79f9b44393c27721fa1fa9138c95387",
"shasum": ""
},
"require": {
@@ -281,9 +281,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.271.7"
"source": "https://github.com/aws/aws-sdk-php/tree/3.272.2"
},
"time": "2023-06-02T18:21:03+00:00"
"time": "2023-06-12T18:21:59+00:00"
},
{
"name": "aws/aws-sdk-php-laravel",
@@ -2002,16 +2002,16 @@
},
{
"name": "fleetbase/core-api",
"version": "1.0.3-alpha",
"version": "1.0.9-alpha",
"source": {
"type": "git",
"url": "https://github.com/fleetbase/core-api.git",
"reference": "77bc9e7df79d9f4559d1633d1c86fe0af7f2a63e"
"reference": "c08873f3b43f969039c6b9694c313057fe1eba46"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fleetbase/core-api/zipball/77bc9e7df79d9f4559d1633d1c86fe0af7f2a63e",
"reference": "77bc9e7df79d9f4559d1633d1c86fe0af7f2a63e",
"url": "https://api.github.com/repos/fleetbase/core-api/zipball/c08873f3b43f969039c6b9694c313057fe1eba46",
"reference": "c08873f3b43f969039c6b9694c313057fe1eba46",
"shasum": ""
},
"require": {
@@ -2085,35 +2085,29 @@
],
"support": {
"issues": "https://github.com/fleetbase/core-api/issues",
"source": "https://github.com/fleetbase/core-api/tree/v1.0.3-alpha"
"source": "https://github.com/fleetbase/core-api/tree/v1.0.9-alpha"
},
"funding": [
{
"url": "https://github.com/fleetbase",
"type": "github"
}
],
"time": "2023-06-05T04:13:52+00:00"
"time": "2023-06-13T15:43:51+00:00"
},
{
"name": "fleetbase/fleetops-api",
"version": "1.0.1-alpha",
"version": "1.0.3-alpha",
"source": {
"type": "git",
"url": "https://github.com/fleetbase/fleetops-api.git",
"reference": "3bcce25a9cf2c9bc991aac26e873ac6eeacaac68"
"reference": "92f468d6e62bac2672b7a339f2053428fe997ea6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fleetbase/fleetops-api/zipball/3bcce25a9cf2c9bc991aac26e873ac6eeacaac68",
"reference": "3bcce25a9cf2c9bc991aac26e873ac6eeacaac68",
"url": "https://api.github.com/repos/fleetbase/fleetops-api/zipball/92f468d6e62bac2672b7a339f2053428fe997ea6",
"reference": "92f468d6e62bac2672b7a339f2053428fe997ea6",
"shasum": ""
},
"require": {
"barryvdh/laravel-dompdf": "^2.0",
"brick/geo": "0.7.2",
"cknow/laravel-money": "^7.1",
"fleetbase/core-api": "^1.0.0-alpha",
"fleetbase/core-api": "^1.0.9-alpha",
"geocoder-php/google-maps-places-provider": "^1.4",
"giggsey/libphonenumber-for-php": "^8.13",
"league/geotools": "^1.1.0",
@@ -2167,33 +2161,27 @@
],
"support": {
"issues": "https://github.com/fleetbase/fleetops-api/issues",
"source": "https://github.com/fleetbase/fleetops-api/tree/v1.0.1-alpha"
"source": "https://github.com/fleetbase/fleetops-api/tree/v1.0.3-alpha"
},
"funding": [
{
"url": "https://github.com/fleetbase",
"type": "github"
}
],
"time": "2023-05-26T04:34:49+00:00"
"time": "2023-06-13T15:46:57+00:00"
},
{
"name": "fleetbase/storefront-api",
"version": "1.0.1-alpha",
"version": "1.0.3-alpha",
"source": {
"type": "git",
"url": "https://github.com/fleetbase/storefront-api.git",
"reference": "0d0dee2b8a173757e0f4e5c4e12c98d6d6dda37e"
"reference": "249923de7168805de25012032fb0ef5120fb6fea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fleetbase/storefront-api/zipball/0d0dee2b8a173757e0f4e5c4e12c98d6d6dda37e",
"reference": "0d0dee2b8a173757e0f4e5c4e12c98d6d6dda37e",
"url": "https://api.github.com/repos/fleetbase/storefront-api/zipball/249923de7168805de25012032fb0ef5120fb6fea",
"reference": "249923de7168805de25012032fb0ef5120fb6fea",
"shasum": ""
},
"require": {
"fleetbase/core-api": "^1.0.0-alpha",
"fleetbase/fleetops-api": "^1.0.0-alpha",
"fleetbase/core-api": "^1.0.9-alpha",
"fleetbase/fleetops-api": "^1.0.3-alpha",
"geocoder-php/google-maps-places-provider": "^1.4",
"laravel-notification-channels/apn": "^3.8",
"laravel-notification-channels/fcm": "^2.7",
@@ -2251,15 +2239,9 @@
],
"support": {
"issues": "https://github.com/fleetbase/storefront-api/issues",
"source": "https://github.com/fleetbase/storefront-api/tree/v1.0.1-alpha"
"source": "https://github.com/fleetbase/storefront-api/tree/v1.0.3-alpha"
},
"funding": [
{
"url": "https://github.com/fleetbase",
"type": "github"
}
],
"time": "2023-05-26T04:39:13+00:00"
"time": "2023-06-13T15:50:51+00:00"
},
{
"name": "fruitcake/laravel-cors",
@@ -2741,16 +2723,16 @@
},
{
"name": "giggsey/libphonenumber-for-php",
"version": "8.13.12",
"version": "8.13.14",
"source": {
"type": "git",
"url": "https://github.com/giggsey/libphonenumber-for-php.git",
"reference": "218caeeeb224bf2f553597b5c3a1647ff936db64"
"reference": "31b94ef2aa349b76bb725f375e9cfa2e398a1620"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/218caeeeb224bf2f553597b5c3a1647ff936db64",
"reference": "218caeeeb224bf2f553597b5c3a1647ff936db64",
"url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/31b94ef2aa349b76bb725f375e9cfa2e398a1620",
"reference": "31b94ef2aa349b76bb725f375e9cfa2e398a1620",
"shasum": ""
},
"require": {
@@ -2809,7 +2791,7 @@
"issues": "https://github.com/giggsey/libphonenumber-for-php/issues",
"source": "https://github.com/giggsey/libphonenumber-for-php"
},
"time": "2023-05-22T07:19:16+00:00"
"time": "2023-06-13T08:08:40+00:00"
},
{
"name": "giggsey/locale",
@@ -3897,16 +3879,16 @@
},
{
"name": "kreait/firebase-php",
"version": "6.9.5",
"version": "6.9.6",
"source": {
"type": "git",
"url": "https://github.com/kreait/firebase-php.git",
"reference": "e64ce87a2d3be0acef91c33aea6269bbd528b12f"
"reference": "d6592be9b27a7c0b13f484f5af494e278901e441"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kreait/firebase-php/zipball/e64ce87a2d3be0acef91c33aea6269bbd528b12f",
"reference": "e64ce87a2d3be0acef91c33aea6269bbd528b12f",
"url": "https://api.github.com/repos/kreait/firebase-php/zipball/d6592be9b27a7c0b13f484f5af494e278901e441",
"reference": "d6592be9b27a7c0b13f484f5af494e278901e441",
"shasum": ""
},
"require": {
@@ -3926,7 +3908,6 @@
"mtdowling/jmespath.php": "^2.6.1",
"php": "^7.4|^8.0",
"psr/cache": "^1.0.1|^2.0|^3.0",
"psr/http-message": "^1.0.1",
"psr/log": "^1.1|^2.0|^3.0",
"riverline/multipart-parser": "^2.0.8",
"symfony/polyfill-php80": "^1.23",
@@ -3987,7 +3968,7 @@
"type": "github"
}
],
"time": "2023-01-27T09:30:40+00:00"
"time": "2023-06-10T06:44:56+00:00"
},
{
"name": "kreait/firebase-tokens",
@@ -5217,6 +5198,71 @@
],
"time": "2022-10-04T09:16:37+00:00"
},
{
"name": "league/flysystem-aws-s3-v3",
"version": "1.0.30",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git",
"reference": "af286f291ebab6877bac0c359c6c2cb017eb061d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/af286f291ebab6877bac0c359c6c2cb017eb061d",
"reference": "af286f291ebab6877bac0c359c6c2cb017eb061d",
"shasum": ""
},
"require": {
"aws/aws-sdk-php": "^3.20.0",
"league/flysystem": "^1.0.40",
"php": ">=5.5.0"
},
"require-dev": {
"henrikbjorn/phpspec-code-coverage": "~1.0.1",
"phpspec/phpspec": "^2.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"League\\Flysystem\\AwsS3v3\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frank de Jonge",
"email": "info@frenky.net"
}
],
"description": "Flysystem adapter for the AWS S3 SDK v3.x",
"support": {
"issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues",
"source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/1.0.30"
},
"funding": [
{
"url": "https://offset.earth/frankdejonge",
"type": "custom"
},
{
"url": "https://github.com/frankdejonge",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/league/flysystem",
"type": "tidelift"
}
],
"time": "2022-07-02T13:51:38+00:00"
},
{
"name": "league/geotools",
"version": "1.1.0",
@@ -7743,6 +7789,64 @@
},
"time": "2022-09-07T10:27:55+00:00"
},
{
"name": "predis/predis",
"version": "v2.1.2",
"source": {
"type": "git",
"url": "https://github.com/predis/predis.git",
"reference": "a77a43913a74f9331f637bb12867eb8e274814e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/predis/predis/zipball/a77a43913a74f9331f637bb12867eb8e274814e5",
"reference": "a77a43913a74f9331f637bb12867eb8e274814e5",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.3",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^8.0 || ~9.4.4"
},
"type": "library",
"autoload": {
"psr-4": {
"Predis\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Till Krüss",
"homepage": "https://till.im",
"role": "Maintainer"
}
],
"description": "A flexible and feature-complete Redis client for PHP.",
"homepage": "http://github.com/predis/predis",
"keywords": [
"nosql",
"predis",
"redis"
],
"support": {
"issues": "https://github.com/predis/predis/issues",
"source": "https://github.com/predis/predis/tree/v2.1.2"
},
"funding": [
{
"url": "https://github.com/sponsors/tillkruss",
"type": "github"
}
],
"time": "2023-03-02T18:32:04+00:00"
},
{
"name": "psr/cache",
"version": "1.0.1",
@@ -13986,16 +14090,16 @@
},
{
"name": "fakerphp/faker",
"version": "v1.22.0",
"version": "v1.23.0",
"source": {
"type": "git",
"url": "https://github.com/FakerPHP/Faker.git",
"reference": "f85772abd508bd04e20bb4b1bbe260a68d0066d2"
"reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FakerPHP/Faker/zipball/f85772abd508bd04e20bb4b1bbe260a68d0066d2",
"reference": "f85772abd508bd04e20bb4b1bbe260a68d0066d2",
"url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e3daa170d00fde61ea7719ef47bb09bb8f1d9b01",
"reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01",
"shasum": ""
},
"require": {
@@ -14048,9 +14152,9 @@
],
"support": {
"issues": "https://github.com/FakerPHP/Faker/issues",
"source": "https://github.com/FakerPHP/Faker/tree/v1.22.0"
"source": "https://github.com/FakerPHP/Faker/tree/v1.23.0"
},
"time": "2023-05-14T12:31:37+00:00"
"time": "2023-06-12T08:44:38+00:00"
},
{
"name": "filp/whoops",
@@ -14311,38 +14415,44 @@
},
{
"name": "mockery/mockery",
"version": "1.5.1",
"version": "1.6.2",
"source": {
"type": "git",
"url": "https://github.com/mockery/mockery.git",
"reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e"
"reference": "13a7fa2642c76c58fa2806ef7f565344c817a191"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mockery/mockery/zipball/e92dcc83d5a51851baf5f5591d32cb2b16e3684e",
"reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e",
"url": "https://api.github.com/repos/mockery/mockery/zipball/13a7fa2642c76c58fa2806ef7f565344c817a191",
"reference": "13a7fa2642c76c58fa2806ef7f565344c817a191",
"shasum": ""
},
"require": {
"hamcrest/hamcrest-php": "^2.0.1",
"lib-pcre": ">=7.0",
"php": "^7.3 || ^8.0"
"php": "^7.4 || ^8.0"
},
"conflict": {
"phpunit/phpunit": "<8.0"
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^9.3"
"phpunit/phpunit": "^8.5 || ^9.3",
"psalm/plugin-phpunit": "^0.18",
"vimeo/psalm": "^5.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
"dev-main": "1.6.x-dev"
}
},
"autoload": {
"psr-0": {
"Mockery": "library/"
"files": [
"library/helpers.php",
"library/Mockery.php"
],
"psr-4": {
"Mockery\\": "library/Mockery"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -14377,9 +14487,9 @@
],
"support": {
"issues": "https://github.com/mockery/mockery/issues",
"source": "https://github.com/mockery/mockery/tree/1.5.1"
"source": "https://github.com/mockery/mockery/tree/1.6.2"
},
"time": "2022-09-07T15:32:08+00:00"
"time": "2023-06-07T09:07:52+00:00"
},
{
"name": "myclabs/deep-copy",
@@ -14958,16 +15068,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.6.8",
"version": "9.6.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e"
"reference": "a9aceaf20a682aeacf28d582654a1670d8826778"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e",
"reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a9aceaf20a682aeacf28d582654a1670d8826778",
"reference": "a9aceaf20a682aeacf28d582654a1670d8826778",
"shasum": ""
},
"require": {
@@ -15041,7 +15151,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.8"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.9"
},
"funding": [
{
@@ -15057,7 +15167,7 @@
"type": "tidelift"
}
],
"time": "2023-05-11T05:14:45+00:00"
"time": "2023-06-11T06:13:56+00:00"
},
{
"name": "sebastian/cli-parser",

Submodule console updated: e42893e2dd...60f97028c6

View File

@@ -38,14 +38,14 @@ services:
ENVIRONMENT: development
application:
volumes:
- .:/var/www/html
build:
context: .
dockerfile: docker/Dockerfile
target: app-dev
args:
ENVIRONMENT: development
ports:
- "8000:80"
environment:
DATABASE_URL: "mysql://root@database/fleetbase"
CACHE_DRIVER: redis
@@ -58,18 +58,4 @@ services:
LOG_CHANNEL: daily
depends_on:
- database
- cache
httpd:
volumes:
- ./api/storage:/var/www/html/api/storage
build:
context: .
dockerfile: docker/httpd/Dockerfile
ports:
- "8000:80"
depends_on:
- application
volumes:
storage:
- cache

View File

@@ -8,9 +8,9 @@ RUN mkdir -p /usr/src/php/ext \
# Install required packages and PHP extensions
RUN apt-get update \
&& apt-get install -y git unzip libzip-dev libgd-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
&& apt-get install -y nano git unzip libzip-dev libgd-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
imagemagick libmagickwand-dev --no-install-recommends libmemcached-dev libgeos-dev libgmp-dev \
default-mysql-client libicu-dev tmux \
default-mysql-client libicu-dev tmux nginx dnsutils \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-configure gd --with-external-gd \
@@ -19,6 +19,9 @@ RUN apt-get update \
&& pecl install redis-4.3.0 memcached-3.1.3 \
&& docker-php-ext-enable redis memcached opcache bcmath
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Update PHP configurations
RUN sed -e 's/^expose_php.*/expose_php = Off/' "$PHP_INI_DIR/php.ini-production" > "$PHP_INI_DIR/php.ini" \
&& sed -i -e 's/^upload_max_filesize.*/upload_max_filesize = 600M/' -e 's/^post_max_size.*/post_max_size = 0/' \
@@ -30,24 +33,41 @@ RUN curl -L https://github.com/springload/ssm-parent/releases/download/v1.4.3/ss
&& rm /tmp/ssm-parent.tar.gz
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# For development only
WORKDIR /var/www/html
COPY --chown=www-data:nogroup packages ./
# Setup application
WORKDIR /var/www/html/api
COPY --chown=www-data:nogroup api ./
RUN chown -R www-data:www-data /var/www/html/api
RUN mkdir -p ./storage/logs/ && ln -sf /dev/stdout ./storage/logs/laravel-$(date +'%Y-%m-%d').log
USER www-data
RUN composer install
RUN composer dumpautoload
# Copy application files
COPY --chown=www-data:www-data api ./
# Install Composer dependencies
RUN composer install --no-dev --no-scripts --no-autoloader
# Continue
USER root
WORKDIR /
# Copy nginx config
COPY nginx.conf /etc/nginx/sites-enabled/default
# Copy the startup script into the Docker image
COPY startup.sh /startup.sh
# Make sure the script is executable
RUN chmod +x /startup.sh
# Set environment
ARG ENVIRONMENT=production
ENV APP_ENV=$ENVIRONMENT
# Set workdir to application
WORKDIR /var/www/html/api
# Scheduler base stage
FROM base as scheduler-base
@@ -68,13 +88,14 @@ CMD ["go-crond", "--verbose", "--no-auto", "root:./crontab"]
# Application dev stage
FROM base as app-dev
ENTRYPOINT ["docker-php-entrypoint"]
CMD ["php-fpm"]
ENTRYPOINT ["docker-php-entrypoint"]
EXPOSE 80
CMD ["/startup.sh"]
# Events stage
FROM base as events
ENTRYPOINT ["/sbin/ssm-parent", "-c", ".ssm-parent.yaml", "run", "--", "docker-php-entrypoint"]
CMD ["php", "artisan", "queue:work", "events"]
CMD ["php", "artisan", "queue:work", "events"]2
# Jobs stage
FROM base as jobs
@@ -84,4 +105,5 @@ CMD ["php", "artisan", "queue:work", "sqs"]
# Application stage
FROM base as app
ENTRYPOINT ["/sbin/ssm-parent", "-c", ".ssm-parent.yaml", "run", "--", "docker-php-entrypoint"]
CMD ["php-fpm"]
EXPOSE 80
CMD ["/startup.sh"]

46
nginx.conf Normal file
View File

@@ -0,0 +1,46 @@
server {
listen 80;
server_name localhost;
root /var/www/html/api/public;
# hide nginx version for security purposes
server_tokens off;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error_log;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location /uploads {
alias /var/www/html/api/storage/app/uploads;
autoindex on;
try_files $uri $uri/ /index.php?$query_string;
}
location /storage {
alias /var/www/html/api/storage/app/public;
autoindex on;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_pass application:9000;
fastcgi_index index.php;
}
}

35
startup.sh Normal file
View File

@@ -0,0 +1,35 @@
#!/bin/bash
# Start PHP-FPM in the background
php-fpm -D
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start php-fpm: $status"
exit $status
fi
# Start Nginx in the foreground
nginx -g "daemon off;"
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start nginx: $status"
exit $status
fi
# Naive check runs checks once a minute to see if either of the processes exited.
while sleep 60; do
ps aux | grep php-fpm | grep -q -v grep
PROCESS_1_STATUS=$?
ps aux |grep nginx |grep -q -v grep
PROCESS_2_STATUS=$?
if [ $PROCESS_1_STATUS -ne 0 ]; then
echo "PHP-FPM process has already exited."
exit 1
fi
if [ $PROCESS_2_STATUS -ne 0 ]; then
echo "Nginx process has already exited."
exit 1
fi
done