Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added docker with php 8.1 #17

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=larapi
DB_USERNAME=root
DB_PASSWORD=
DB_USERNAME=larapi
DB_PASSWORD=larapi

# REDIS CONFIG
REDIS_HOST=127.0.0.1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ yarn-error.log
cghooks.lock
.idea/*

# Docker
/docker/data
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,32 @@ Configure your local Virtual Host. After that visit the host URL and you will se
"status": 200
}
```
## Configuring the project with Docker

### Steps of build

sudo docker compose -f stack-ubuntu-local.yaml up -d --build # For Ubuntu

sudo docker compose -f stack-rhel-local.yaml up -d --build # For RHEL

sudo docker exec php composer new-install
sudo docker exec php composer set-permissions

### Running Migrations
sudo docker exec php php artisan migrate

## Configuring the project with Podman

### Steps of build

sudo podman-compose -f stack-ubuntu-local.yaml up -d --build # For Ubuntu
sudo podman-compose -f stack-rhel-local.yaml up -d --build # For RHEL

sudo podman exec php composer new-install
sudo podman exec php composer set-permissions

### Running Migrations
sudo podman exec php php artisan migrate

## App Architecture

Expand Down
9 changes: 7 additions & 2 deletions app/Core/Http/Middlewares/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace LarAPI\Core\Http\Middlewares;

use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;

class TrustProxies extends Middleware
Expand All @@ -19,5 +19,10 @@ class TrustProxies extends Middleware
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}
38 changes: 30 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@
}
],
"require": {
"php": "^7.4",
"php": "^8.1",
"ext-curl": "*",
"ext-json": "*",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"fruitcake/laravel-cors": "^3.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.0",
"laravel/framework": "^9.0",
"laravel/tinker": "^2.0",
"predis/predis": "^1.1",
"tymon/jwt-auth": "^1.0",
"zircote/swagger-php": "^3.0"
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.8",
"facade/ignition": "^2.3.6",
"friendsofphp/php-cs-fixer": "^2.16",
"brainmaestro/composer-git-hooks": "^v3.0.0-alpha.1",
"spatie/laravel-ignition": "^1.0",
"friendsofphp/php-cs-fixer": "^3.0.10",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^5.0",
"nunomaduro/collision": "^6.2.1",
"phpunit/phpunit": "^9.0"
},
"config": {
Expand Down Expand Up @@ -75,6 +74,23 @@
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"set-permissions": "find bootstrap/cache -type d -exec chmod 777 {} + && find storage -type d -exec chmod 777 {} +",
"new-install": [
"@composer install",
"@php artisan key:generate --ansi",
"@php artisan migrate --seed --force --ansi",
"@php artisan storage:link"
],
"update-install": [
"@composer update",
"@php artisan migrate --ansi",
"@php artisan storage:link"
],
"update-install--seed": [
"@composer update",
"@php artisan migrate --seed --force --ansi",
"@php artisan storage:link"
],
"post-install-cmd": [
"cghooks add --ignore-lock"
],
Expand All @@ -85,6 +101,12 @@
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"cghooks": "./vendor/bin/cghooks",
"lint": "./vendor/bin/php-cs-fixer fix ./app --using-cache=false --rules=@PSR2",
"lint:check": "./vendor/bin/php-cs-fixer fix ./app --using-cache=false --dry-run --rules=@PSR2",
Expand Down
Loading