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

docker-compose configuration with environment variables #1

Open
wants to merge 2 commits into
base: master
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
APACHE_PORT=8001

MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=development
MYSQL_USER=developer
MYSQL_PASSWORD=developer
MYSQL_PORT=3306

PHP_MYADMIN_PORT=8000
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
dump/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM php:7.3-apache
FROM php:5.6-apache
RUN docker-php-ext-install mysqli
20 changes: 10 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
www:
build: .
ports:
- "8001:80"
- "${APACHE_PORT}:80"
volumes:
- ./www:/var/www/html/
links:
Expand All @@ -13,13 +13,13 @@ services:
db:
image: mysql:8.0
ports:
- "3306:3306"
- ${MYSQL_PORT}:3306
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_DATABASE: myDb
MYSQL_USER: user
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: test
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
volumes:
- ./dump:/docker-entrypoint-initdb.d
- ./conf:/etc/mysql/conf.d
Expand All @@ -31,10 +31,10 @@ services:
links:
- db:db
ports:
- 8000:80
- ${PHP_MYADMIN_PORT}:80
environment:
MYSQL_USER: user
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: test
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
volumes:
persistent:
24 changes: 0 additions & 24 deletions dump/myDb.sql

This file was deleted.

32 changes: 32 additions & 0 deletions extranet_boom/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=
3 changes: 3 additions & 0 deletions extranet_boom/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
12 changes: 12 additions & 0 deletions extranet_boom/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/node_modules
/public/storage
/storage/*.key
/vendor
/.idea
Homestead.json
Homestead.yaml
.env
public/Static_Full_Version
public/js/demo
artisan
public/js/plugins/diff_match_patch
2 changes: 2 additions & 0 deletions extranet_boom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# extranet-boom-digital

24 changes: 24 additions & 0 deletions extranet_boom/app/Bill.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Bill extends Model
{
/**
* Get the client record associated with the budget.
*/
public function client()
{
return $this->belongsTo('App\Client');
}

/**
* Get the budget record associated with the bill.
*/
public function budget()
{
return $this->belongsTo('App\Budget');
}
}
24 changes: 24 additions & 0 deletions extranet_boom/app/Brand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Brand extends Model
{
/**
* Get the client record associated with the brand.
*/
public function client()
{
return $this->belongsTo('App\Client');
}

/**
* Get the budget record associated with the brand.
*/
public function budget()
{
return $this->belongsTo('App\Budget');
}
}
32 changes: 32 additions & 0 deletions extranet_boom/app/Budget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Budget extends Model
{
/**
* Get the client record associated with the budget.
*/
public function client()
{
return $this->belongsTo('App\Client');
}

/**
* Get the brand record associated with the budget.
*/
public function brand()
{
return $this->belongsTo('App\Brand');
}

/**
* Get the brand record associated with the budget.
*/
public function contact()
{
return $this->belongsTo('App\Contact');
}
}
32 changes: 32 additions & 0 deletions extranet_boom/app/Client.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Client extends Model
{
/**
* Get the brand record associated with the client.
*/
public function brand()
{
return $this->hasMany('App\Brand');
}

/**
* Get the contact record associated with the client.
*/
public function contact()
{
return $this->hasMany('App\Contact');
}

/**
* Get the budget record associated with the client.
*/
public function budget()
{
return $this->hasMany('App\Budget');
}
}
40 changes: 40 additions & 0 deletions extranet_boom/app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];

/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}

/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{
require base_path('routes/console.php');
}
}
24 changes: 24 additions & 0 deletions extranet_boom/app/Contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Contact extends Model
{
/**
* Get the client record associated with the Contact.
*/
public function client()
{
return $this->belongsTo('App\Client');
}

/**
* Get the budget record associated with the Contact.
*/
public function budget()
{
return $this->belongsTo('App\Budget');
}
}
65 changes: 65 additions & 0 deletions extranet_boom/app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
];

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
{
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}

/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}

return redirect()->guest('login');
}
}
Loading