generated from thegrind/laravel-dockerized
Small updates for the docker image
This commit is contained in:
parent
de8277a303
commit
23cdba7d8a
@ -4,8 +4,8 @@ COPY ./hook.sh /app/hook.sh
|
|||||||
# Get the app in there
|
# Get the app in there
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
ENV ENABLE_QUEUE_WORKER=true
|
# ENV ENABLE_QUEUE_WORKER=true
|
||||||
ENV ENABLE_SCHEDULER=true
|
# ENV ENABLE_SCHEDULER=true
|
||||||
|
|
||||||
VOLUME [ "/app/storage/oauth" ]
|
VOLUME [ "/app/storage/oauth" ]
|
||||||
VOLUME [ "/app/database" ]
|
VOLUME [ "/app/database" ]
|
3
Makefile
3
Makefile
@ -17,6 +17,7 @@ setup: ## Install Laravel Octane with FrankenPHP
|
|||||||
# Docker build targets
|
# Docker build targets
|
||||||
build: ## Build the Docker image
|
build: ## Build the Docker image
|
||||||
@echo "Building Docker image: $(IMAGE_NAME):$(VERSION)"
|
@echo "Building Docker image: $(IMAGE_NAME):$(VERSION)"
|
||||||
|
npm run build
|
||||||
docker build -t $(IMAGE_NAME):$(VERSION) .
|
docker build -t $(IMAGE_NAME):$(VERSION) .
|
||||||
@echo "✅ Image built successfully"
|
@echo "✅ Image built successfully"
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ run: ## Run the container (production-like)
|
|||||||
-p $(PORT):8000 \
|
-p $(PORT):8000 \
|
||||||
-e APP_NAME="AuthentiKate" \
|
-e APP_NAME="AuthentiKate" \
|
||||||
-e APP_ENV=production \
|
-e APP_ENV=production \
|
||||||
-e APP_DEBUG=false \
|
-e APP_DEBUG=true \
|
||||||
-e APP_KEY=base64:$$(openssl rand -base64 32) \
|
-e APP_KEY=base64:$$(openssl rand -base64 32) \
|
||||||
-e APP_URL=http://localhost:$(PORT) \
|
-e APP_URL=http://localhost:$(PORT) \
|
||||||
-e DB_CONNECTION=sqlite \
|
-e DB_CONNECTION=sqlite \
|
||||||
|
@ -34,7 +34,7 @@ class CreateInitialAdmin extends Command
|
|||||||
// Check if admin users already exist (unless forced)
|
// Check if admin users already exist (unless forced)
|
||||||
if (!$this->option('force') && User::where('is_admin', true)->exists()) {
|
if (!$this->option('force') && User::where('is_admin', true)->exists()) {
|
||||||
$this->error('Admin users already exist! Use --force to create anyway.');
|
$this->error('Admin users already exist! Use --force to create anyway.');
|
||||||
return 1;
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get user input for email and name
|
// Get user input for email and name
|
||||||
@ -44,13 +44,13 @@ class CreateInitialAdmin extends Command
|
|||||||
// Validate email format
|
// Validate email format
|
||||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||||
$this->error('Invalid email address format.');
|
$this->error('Invalid email address format.');
|
||||||
return 1;
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if email already exists
|
// Check if email already exists
|
||||||
if (User::where('email', $email)->exists()) {
|
if (User::where('email', $email)->exists()) {
|
||||||
$this->error("A user with email '{$email}' already exists.");
|
$this->error("A user with email '{$email}' already exists.");
|
||||||
return 1;
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate a random password
|
// Generate a random password
|
||||||
@ -68,16 +68,16 @@ class CreateInitialAdmin extends Command
|
|||||||
// Display success message with login credentials
|
// Display success message with login credentials
|
||||||
$this->info('✅ Initial admin user created successfully!');
|
$this->info('✅ Initial admin user created successfully!');
|
||||||
$this->newLine();
|
$this->newLine();
|
||||||
|
|
||||||
$this->line('🔐 <options=bold>Login Credentials:</options=bold>');
|
$this->line('🔐 <options=bold>Login Credentials:</options=bold>');
|
||||||
$this->line("📧 Email: <fg=yellow>{$email}</>");
|
$this->line("📧 Email: <fg=yellow>{$email}</>");
|
||||||
$this->line("🔑 Password: <fg=yellow>{$password}</>");
|
$this->line("🔑 Password: <fg=yellow>{$password}</>");
|
||||||
$this->newLine();
|
$this->newLine();
|
||||||
|
|
||||||
$this->warn('⚠️ Please log in and change your password immediately!');
|
$this->warn('⚠️ Please log in and change your password immediately!');
|
||||||
$this->info('💡 You can access the admin panel to manage users and applications.');
|
$this->info('💡 You can access the admin panel to manage users and applications.');
|
||||||
|
|
||||||
return 0;
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -91,22 +91,22 @@ class CreateInitialAdmin extends Command
|
|||||||
$uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
$uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||||
$numbers = '0123456789';
|
$numbers = '0123456789';
|
||||||
$symbols = '!@#$%^&*()_+-=[]{}|;:,.<>?';
|
$symbols = '!@#$%^&*()_+-=[]{}|;:,.<>?';
|
||||||
|
|
||||||
$password = '';
|
$password = '';
|
||||||
|
|
||||||
// Ensure at least one character from each category
|
// Ensure at least one character from each category
|
||||||
$password .= $lowercase[random_int(0, strlen($lowercase) - 1)];
|
$password .= $lowercase[random_int(0, strlen($lowercase) - 1)];
|
||||||
$password .= $uppercase[random_int(0, strlen($uppercase) - 1)];
|
$password .= $uppercase[random_int(0, strlen($uppercase) - 1)];
|
||||||
$password .= $numbers[random_int(0, strlen($numbers) - 1)];
|
$password .= $numbers[random_int(0, strlen($numbers) - 1)];
|
||||||
$password .= $symbols[random_int(0, strlen($symbols) - 1)];
|
$password .= $symbols[random_int(0, strlen($symbols) - 1)];
|
||||||
|
|
||||||
// Fill the rest with random characters from all categories
|
// Fill the rest with random characters from all categories
|
||||||
$allChars = $lowercase . $uppercase . $numbers . $symbols;
|
$allChars = $lowercase . $uppercase . $numbers . $symbols;
|
||||||
for ($i = 4; $i < $length; $i++) {
|
for ($i = 4; $i < $length; $i++) {
|
||||||
$password .= $allChars[random_int(0, strlen($allChars) - 1)];
|
$password .= $allChars[random_int(0, strlen($allChars) - 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shuffle the password to randomize the order
|
// Shuffle the password to randomize the order
|
||||||
return str_shuffle($password);
|
return str_shuffle($password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
{{--
|
|
||||||
fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" {{ $attributes }}
|
|
||||||
--}}
|
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<svg fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" {{ $attributes }} zoomAndPan="magnify"
|
<svg fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" {{ $attributes }} zoomAndPan="magnify"
|
||||||
viewBox="0 0 174.75 204" preserveAspectRatio="xMidYMid" version="1.2" id="svg19"
|
viewBox="0 0 174.75 204" preserveAspectRatio="xMidYMid" version="1.2" id="svg19"
|
||||||
|
Before Width: | Height: | Size: 414 KiB After Width: | Height: | Size: 414 KiB |
@ -1,6 +1,7 @@
|
|||||||
<div class="flex aspect-square size-10 items-center justify-center rounded-md dark:bg-white text-accent-foreground">
|
{{-- <div
|
||||||
|
class="flex aspect-square size-10 items-center justify-center rounded-md dark:bg-white text-accent-foreground">
|
||||||
<x-app-logo-icon class="size-10 fill-current text-white dark:text-black" />
|
<x-app-logo-icon class="size-10 fill-current text-white dark:text-black" />
|
||||||
</div>
|
</div> --}}
|
||||||
<div class="ms-1 grid flex-1 text-start text-sm">
|
<div class="ms-1 grid flex-1 text-start text-sm">
|
||||||
<span class="mb-0.5 truncate leading-tight font-semibold">{{ config('app.name') }}</span>
|
<span class="mb-0.5 truncate leading-tight font-semibold">{{ config('app.name') }}</span>
|
||||||
</div>
|
</div>
|
@ -14,7 +14,8 @@
|
|||||||
class="absolute inset-0 bg-neutral-900"></div>
|
class="absolute inset-0 bg-neutral-900"></div>
|
||||||
<a href="{{ route('home') }}" class="relative z-20 flex items-center text-lg font-medium" wire:navigate>
|
<a href="{{ route('home') }}" class="relative z-20 flex items-center text-lg font-medium" wire:navigate>
|
||||||
<span class="flex h-10 w-10 items-center justify-center rounded-md">
|
<span class="flex h-10 w-10 items-center justify-center rounded-md">
|
||||||
<x-app-logo-icon class="me-2 h-7 fill-current text-white" />
|
{{--
|
||||||
|
<x-app-logo-icon class="me-2 h-7 fill-current text-white" /> --}}
|
||||||
</span>
|
</span>
|
||||||
{{ config('app.name', 'Laravel') }}
|
{{ config('app.name', 'Laravel') }}
|
||||||
</a>
|
</a>
|
||||||
@ -38,7 +39,8 @@
|
|||||||
<a href="{{ route('home') }}" class="z-20 flex flex-col items-center gap-2 font-medium lg:hidden"
|
<a href="{{ route('home') }}" class="z-20 flex flex-col items-center gap-2 font-medium lg:hidden"
|
||||||
wire:navigate>
|
wire:navigate>
|
||||||
<span class="flex h-9 w-9 items-center justify-center rounded-md">
|
<span class="flex h-9 w-9 items-center justify-center rounded-md">
|
||||||
<x-app-logo-icon class="size-9 fill-current text-black dark:text-white" />
|
{{--
|
||||||
|
<x-app-logo-icon class="size-9 fill-current text-black dark:text-white" /> --}}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="sr-only">{{ config('app.name', 'Laravel') }}</span>
|
<span class="sr-only">{{ config('app.name', 'Laravel') }}</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user