DO NOT PR THIS BRANCHgit add .!; DONE: add docker config for development
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
.git
|
||||||
|
node_modules
|
||||||
|
vendor
|
||||||
|
storage/logs
|
||||||
|
storage/framework/cache
|
||||||
|
storage/framework/sessions
|
||||||
|
storage/framework/views
|
||||||
|
storage/debugbar
|
||||||
|
npm-debug.log
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
+66
@@ -0,0 +1,66 @@
|
|||||||
|
APP_NAME=Lumen
|
||||||
|
APP_ENV=local
|
||||||
|
APP_KEY=WbPGkYNmXZ6ZQplGlvl0iZ7zyW1b09xa
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_URL=http://localhost
|
||||||
|
APP_TIMEZONE=Asia/Kuala_Lumpur
|
||||||
|
|
||||||
|
LOG_CHANNEL=stack
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
LOG_SLACK_WEBHOOK_URL=
|
||||||
|
|
||||||
|
DB_CONNECTION=mysql
|
||||||
|
DB_HOST=mysql
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_DATABASE=erahn_xtra
|
||||||
|
DB_USERNAME=root
|
||||||
|
DB_PASSWORD=root
|
||||||
|
|
||||||
|
DB_CONNECTION_7=mysql
|
||||||
|
DB_HOST_7=mysql
|
||||||
|
DB_PORT_7=3306
|
||||||
|
DB_DATABASE_7=master_erahn
|
||||||
|
DB_USERNAME_7=root
|
||||||
|
DB_PASSWORD_7=root
|
||||||
|
|
||||||
|
# DB_CONNECTION_3=mysql
|
||||||
|
# DB_HOST_3=127.0.0.1
|
||||||
|
# DB_PORT_3=3306
|
||||||
|
# DB_DATABASE_3=erahn_baling
|
||||||
|
# DB_USERNAME_3=root
|
||||||
|
# DB_PASSWORD_3=root
|
||||||
|
|
||||||
|
# DB_CONNECTION_4=mysql
|
||||||
|
# DB_HOST_4=127.0.0.1
|
||||||
|
# DB_PORT_4=3306
|
||||||
|
# DB_DATABASE_4=arrahn_ld
|
||||||
|
# DB_USERNAME_4=root
|
||||||
|
# DB_PASSWORD_4=root
|
||||||
|
|
||||||
|
# DB_CONNECTION_5=mysql
|
||||||
|
# DB_HOST_5=127.0.0.1
|
||||||
|
# DB_PORT_5=3306
|
||||||
|
# DB_DATABASE_5=erahn_segamat
|
||||||
|
# DB_USERNAME_5=root
|
||||||
|
# DB_PASSWORD_5=root
|
||||||
|
|
||||||
|
# DB_CONNECTION_6=mysql
|
||||||
|
# DB_HOST_6=127.0.0.1
|
||||||
|
# DB_PORT_6=3306
|
||||||
|
# DB_DATABASE_6=arrahn_kb2
|
||||||
|
# DB_USERNAME_6=spider
|
||||||
|
# DB_PASSWORD_6=G0dz!ll42020
|
||||||
|
|
||||||
|
|
||||||
|
# DB_CONNECTION_8=mysql
|
||||||
|
# DB_HOST_8=127.0.0.1
|
||||||
|
# DB_PORT_8=3306
|
||||||
|
# DB_DATABASE_8=arrahn_klanas
|
||||||
|
# DB_USERNAME_8=spider
|
||||||
|
# DB_PASSWORD_8=G0dz!ll42020
|
||||||
|
|
||||||
|
TENNANT_MASTER_DB=master_erahn
|
||||||
|
TENNANT_KAUNTER_DB=kaunter_erahn
|
||||||
|
|
||||||
|
CACHE_DRIVER=file
|
||||||
|
QUEUE_CONNECTION=sync
|
||||||
+1
-1
@@ -5,6 +5,6 @@ Homestead.yaml
|
|||||||
.env
|
.env
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
ray.php
|
ray.php
|
||||||
docker-compose.yml
|
|
||||||
/docker_src
|
/docker_src
|
||||||
/.vscode
|
/.vscode
|
||||||
|
**/.DS_Store
|
||||||
@@ -1 +1,17 @@
|
|||||||
You know what is this when you in this project
|
You know what is this when you in this project
|
||||||
|
|
||||||
|
If you does't know what is this you probably in wrong project
|
||||||
|
|
||||||
|
```sql
|
||||||
|
--- for all ip
|
||||||
|
CREATE USER 'master_erahn'@'%' IDENTIFIED BY 'password';
|
||||||
|
|
||||||
|
--- for specific ip
|
||||||
|
CREATE USER 'kaunter_erahn'@'localhost' IDENTIFIED BY 'password';
|
||||||
|
|
||||||
|
GRANT ALL PRIVILEGES ON kaunter_erahn.* TO 'kaunter_erahn'@'%';
|
||||||
|
FLUSH PRIVILEGES;
|
||||||
|
```
|
||||||
|
|
||||||
|
Gadai=Pembiayaan
|
||||||
|
Tebus=penyelesaian penuh/ansuran
|
||||||
@@ -23,6 +23,33 @@ $app = new Laravel\Lumen\Application(
|
|||||||
dirname(__DIR__)
|
dirname(__DIR__)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
| Laravel's storage_path() helper resolves app('path.storage'). Lumen does not
|
||||||
|
| register that binding by default; config files that call storage_path() at
|
||||||
|
| load time (e.g. config/logging.php) would fail without this.
|
||||||
|
*/
|
||||||
|
$app->instance('path.storage', $app->storagePath());
|
||||||
|
|
||||||
|
/*
|
||||||
|
| Laravel's Foundation helpers are loaded before Lumen's and win for names like
|
||||||
|
| response() and url(). Those helpers resolve Illuminate\Contracts\* from the
|
||||||
|
| container; Lumen only registers the "url" service, not the contracts. Map the
|
||||||
|
| contracts to Lumen's implementations so helpers work across the app.
|
||||||
|
*/
|
||||||
|
$app->singleton(
|
||||||
|
\Illuminate\Contracts\Routing\ResponseFactory::class,
|
||||||
|
function () {
|
||||||
|
return new \Laravel\Lumen\Http\ResponseFactory();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$app->singleton(
|
||||||
|
\Illuminate\Contracts\Routing\UrlGenerator::class,
|
||||||
|
function ($app) {
|
||||||
|
return $app->make('url');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
$app->withFacades();
|
$app->withFacades();
|
||||||
|
|
||||||
$app->withEloquent();
|
$app->withEloquent();
|
||||||
@@ -60,6 +87,7 @@ $app->singleton(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$app->configure('app');
|
$app->configure('app');
|
||||||
|
$app->configure('logging');
|
||||||
$app->configure('tinker');
|
$app->configure('tinker');
|
||||||
$app->configure('tennant_database');
|
$app->configure('tennant_database');
|
||||||
$app->configure('report');
|
$app->configure('report');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'url' => env('APP_URL', url('/')),
|
'url' => env('APP_URL', 'http://localhost'),
|
||||||
'api_arrahnbid' => env('API_ARRAHNBID', 'http://lelong.test/api/'),
|
'api_arrahnbid' => env('API_ARRAHNBID', 'http://lelong.test/api/'),
|
||||||
'api_v3' => env('API_V3', 'http://apiv3.localhost/api/')
|
'api_v3' => env('API_V3', 'http://apiv3.localhost/api/')
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Monolog\Handler\NullHandler;
|
||||||
|
use Monolog\Handler\StreamHandler;
|
||||||
|
use Monolog\Handler\SyslogUdpHandler;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Log Channel
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option defines the default log channel that gets used when writing
|
||||||
|
| messages to the logs. The name specified in this option should match
|
||||||
|
| one of the channels defined in the "channels" configuration array.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('LOG_CHANNEL', 'stack'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Log Channels
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the log channels for your application. Out of
|
||||||
|
| the box, Laravel uses the Monolog PHP logging library. This gives
|
||||||
|
| you a variety of powerful log handlers / formatters to utilize.
|
||||||
|
|
|
||||||
|
| Available Drivers: "single", "daily", "slack", "syslog",
|
||||||
|
| "errorlog", "monolog", "custom", "stack"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'channels' => [
|
||||||
|
'stack' => [
|
||||||
|
'driver' => 'stack',
|
||||||
|
'channels' => ['single'],
|
||||||
|
'ignore_exceptions' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'single' => [
|
||||||
|
'driver' => 'single',
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'daily' => [
|
||||||
|
'driver' => 'daily',
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'days' => 14,
|
||||||
|
],
|
||||||
|
|
||||||
|
'slack' => [
|
||||||
|
'driver' => 'slack',
|
||||||
|
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
|
'username' => 'Laravel Log',
|
||||||
|
'emoji' => ':boom:',
|
||||||
|
'level' => env('LOG_LEVEL', 'critical'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'papertrail' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'handler' => SyslogUdpHandler::class,
|
||||||
|
'handler_with' => [
|
||||||
|
'host' => env('PAPERTRAIL_URL'),
|
||||||
|
'port' => env('PAPERTRAIL_PORT'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'stderr' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'handler' => StreamHandler::class,
|
||||||
|
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||||
|
'with' => [
|
||||||
|
'stream' => 'php://stderr',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'syslog' => [
|
||||||
|
'driver' => 'syslog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'errorlog' => [
|
||||||
|
'driver' => 'errorlog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'null' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'handler' => NullHandler::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
'emergency' => [
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: docker/php/Dockerfile
|
||||||
|
working_dir: /var/www/html
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www/html:cached
|
||||||
|
environment:
|
||||||
|
APP_ENV: local
|
||||||
|
APP_DEBUG: "true"
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
|
||||||
|
web:
|
||||||
|
image: nginx:1.25-alpine
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www/html:cached
|
||||||
|
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
image: mysql:8.0
|
||||||
|
command: --default-authentication-plugin=mysql_native_password
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: erahn_xtra
|
||||||
|
MYSQL_USER: xtrauser
|
||||||
|
MYSQL_PASSWORD: password
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
volumes:
|
||||||
|
- mysql_data:/var/lib/mysql
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mysql_data:
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /var/www/html/public;
|
||||||
|
index index.php index.html;
|
||||||
|
|
||||||
|
charset utf-8;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
fastcgi_pass app:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.(?!well-known).* {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
FROM php:7.4-fpm
|
||||||
|
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
git \
|
||||||
|
pkg-config \
|
||||||
|
unzip \
|
||||||
|
libonig-dev \
|
||||||
|
libzip-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
|
&& docker-php-ext-install -j"$(nproc)" \
|
||||||
|
pdo_mysql \
|
||||||
|
mbstring \
|
||||||
|
bcmath \
|
||||||
|
zip \
|
||||||
|
exif \
|
||||||
|
gd \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
|
||||||
|
|
||||||
|
COPY docker/php/php.ini /usr/local/etc/php/conf.d/app.ini
|
||||||
|
|
||||||
|
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
memory_limit=512M
|
||||||
|
upload_max_filesize=50M
|
||||||
|
post_max_size=50M
|
||||||
|
max_execution_time=120
|
||||||
Reference in New Issue
Block a user