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

Add docker #16

Open
wants to merge 5 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
10 changes: 5 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ SESSION_LIFETIME=120

# DB CONFIG
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=larapi
DB_USERNAME=root
DB_PASSWORD=
DB_USERNAME=larapi_db_user
DB_PASSWORD=secret

# REDIS CONFIG
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_HOST=redis
REDIS_PASSWORD=secret_redis_password
REDIS_PORT=6379

# MAIL CONFIG
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ npm-debug.log
yarn-error.log
cghooks.lock
.idea/*

/docker/.entrypoints
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Include the ENVs variable
-include make/.env

# Well documented Makefiles
# @see https://www.thapaliya.com/en/writings/well-documented-makefiles/
DEFAULT_GOAL := help
help:
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-40s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

# Include all makefiles from the make folder
include make/*.mk

# Common variable to pass arbitrary options to targets
ARGS?=

##@ [Make]

.PHONY: make-init
make-init: ENVS= ## Initializes the make/.env file with ENV variables for make
make-init:
@[ -f make/.env ] && echo ".env file exists" || cp make/.env.example make/.env
@echo "Please update your make/.env file with your settings"

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;
}
1 change: 1 addition & 0 deletions app/Core/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function map()
* )
*/
Route::get('/', function () {
dd(phpinfo());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

return response()->json([
'application' => config('app.name'),
'environment' => config('app.env'),
Expand Down
15 changes: 7 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.0",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're going to use PHP 8.1 features, put here as 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
Loading