Skip to content

Commit

Permalink
dev: Docker healthcheck.
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed May 1, 2024
1 parent e12355a commit 4efac9a
Show file tree
Hide file tree
Showing 19 changed files with 64 additions and 23 deletions.
6 changes: 3 additions & 3 deletions dev/.env
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ DB_CONNECTION=sqlite
# DB_USERNAME=root
# DB_PASSWORD=

SESSION_DRIVER=database
SESSION_DRIVER=array
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
QUEUE_CONNECTION=null

CACHE_STORE=database
CACHE_STORE=null
CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1
Expand Down
2 changes: 0 additions & 2 deletions dev/bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
Expand Down
4 changes: 3 additions & 1 deletion dev/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": false
"allow-plugins": {
"php-http/discovery": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
1 change: 0 additions & 1 deletion dev/database/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions dev/database/factories/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions dev/database/migrations/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions dev/database/seeders/.gitignore

This file was deleted.

21 changes: 21 additions & 0 deletions dev/public/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Empty file added dev/public/favicon.ico
Empty file.
21 changes: 21 additions & 0 deletions dev/public/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php declare(strict_types = 1);

use Illuminate\Http\Request;

// phpcs:disable PSR1.Files.SideEffects

define('LARAVEL_START', microtime(true));

// Determine if the application is in maintenance mode...
$maintenance = __DIR__.'/../storage/framework/maintenance.php';

if (file_exists($maintenance)) {
require $maintenance;
}

// Register the Composer autoloader...
require __DIR__.'/../vendor/autoload.php';

// Bootstrap Laravel and handle the request...
(require_once __DIR__.'/../bootstrap/app.php')
->handleRequest(Request::capture());
2 changes: 1 addition & 1 deletion dev/storage/app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
public
*
!public/
!.gitignore
2 changes: 1 addition & 1 deletion dev/storage/app/public/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.gitignore
*
!.gitignore
2 changes: 1 addition & 1 deletion dev/storage/framework/cache/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
data
*
!data/
!.gitignore
2 changes: 1 addition & 1 deletion dev/storage/framework/cache/data/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.gitignore
*
!.gitignore
2 changes: 1 addition & 1 deletion dev/storage/framework/sessions/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.gitignore
*
!.gitignore
2 changes: 1 addition & 1 deletion dev/storage/framework/testing/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.gitignore
*
!.gitignore
3 changes: 1 addition & 2 deletions dev/storage/framework/views/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.gitignore
!.gitignore
*
!.gitignore
2 changes: 1 addition & 1 deletion dev/storage/logs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.gitignore
*
!.gitignore
9 changes: 8 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ services:
depends_on:
setup:
condition: service_completed_successfully
command: sleep infinity
command: |
php -S localhost:8000 -t ./dev/public
healthcheck:
test: curl -f http://localhost:8000/up || exit 1
start_period: 1m
interval: 1m
timeout: 10s
retries: 3

setup:
<<: *project
Expand Down

0 comments on commit 4efac9a

Please sign in to comment.