Update bug waiting laravel

This commit is contained in:
servdal
2025-07-17 08:13:00 +07:00
parent 8289968849
commit 9437483030
7 changed files with 65 additions and 26 deletions

View File

@@ -63,7 +63,7 @@ WORKDIR /var/www/html
# RUN composer create-project laravel/laravel:^10 /var/www/html
# Set permission
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
#RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
EXPOSE 9000
#CMD ["php-fpm"]

View File

@@ -11,13 +11,15 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('samples', function (Blueprint $table) {
$table->id();
$table->string('patient_name', 250)->nullable();
$table->string('test_details', 255)->nullable();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
});
if (!Schema::hasTable('samples')) {
Schema::create('samples', function (Blueprint $table) {
$table->id();
$table->string('patient_name', 250)->nullable();
$table->string('test_details', 255)->nullable();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
});
}
}
/**

View File

@@ -11,16 +11,18 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('test_results', function (Blueprint $table) {
$table->id(); // ID primary key
$table->unsignedBigInteger('sample_id'); // Kolom referensi
$table->text('result'); // Kolom result
$table->string('status', 50); // Kolom status
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
// Foreign key
$table->foreign('sample_id')->references('id')->on('samples')->onDelete('cascade');
});
if (!Schema::hasTable('test_results')) {
Schema::create('test_results', function (Blueprint $table) {
$table->id(); // ID primary key
$table->unsignedBigInteger('sample_id'); // Kolom referensi
$table->text('result'); // Kolom result
$table->string('status', 50); // Kolom status
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
// Foreign key
$table->foreign('sample_id')->references('id')->on('samples')->onDelete('cascade');
});
}
}
/**

View File

@@ -13,8 +13,7 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
User::factory(10)->create();
User::factory()->create([
User::create([
'nama' => 'Administrator',
'username' => 'admin',
'password' => bcrypt('semangat'),

View File

@@ -1,10 +1,5 @@
#!/bin/bash
# Tunggu database siap
until php artisan migrate:status > /dev/null 2>&1; do
echo "Waiting for database to be ready..."
sleep 3
done
# Cek apakah migration sudah pernah dijalankan
if php artisan migrate:status | grep -q "| Y"; then

View File

@@ -1590,3 +1590,43 @@ OBR|||1|TEST123^Exa
2025-07-17 00:27:40,799 - ERROR - Failed to bind to port 6001: [Errno 98] Address already in use
2025-07-17 00:27:40,825 - WARNING - * Debugger is active!
2025-07-17 00:27:40,826 - INFO - * Debugger PIN: 139-464-079
2025-07-17 00:57:38,623 - INFO - Listening on TCP port 6001...
2025-07-17 00:57:38,798 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://172.18.0.4:5000
2025-07-17 00:57:38,798 - INFO - Press CTRL+C to quit
2025-07-17 00:57:38,799 - INFO - * Restarting with stat
2025-07-17 00:57:42,059 - ERROR - Failed to bind to port 6001: [Errno 98] Address already in use
2025-07-17 00:57:42,102 - WARNING - * Debugger is active!
2025-07-17 00:57:42,111 - INFO - * Debugger PIN: 682-061-109
2025-07-17 01:07:55,681 - INFO - Listening on TCP port 6001...
2025-07-17 01:07:56,048 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://172.18.0.3:5000
2025-07-17 01:07:56,048 - INFO - Press CTRL+C to quit
2025-07-17 01:07:56,050 - INFO - * Restarting with stat
2025-07-17 01:08:00,741 - ERROR - Failed to bind to port 6001: [Errno 98] Address already in use
2025-07-17 01:08:00,765 - WARNING - * Debugger is active!
2025-07-17 01:08:00,767 - INFO - * Debugger PIN: 455-916-409
2025-07-17 01:10:05,931 - INFO - Listening on TCP port 6001...
2025-07-17 01:10:06,006 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://172.18.0.3:5000
2025-07-17 01:10:06,007 - INFO - Press CTRL+C to quit
2025-07-17 01:10:06,008 - INFO - * Restarting with stat
2025-07-17 01:10:10,441 - ERROR - Failed to bind to port 6001: [Errno 98] Address already in use
2025-07-17 01:10:10,464 - WARNING - * Debugger is active!
2025-07-17 01:10:10,465 - INFO - * Debugger PIN: 195-044-760
2025-07-17 01:11:48,115 - INFO - Listening on TCP port 6001...
2025-07-17 01:11:48,313 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://172.18.0.3:5000
2025-07-17 01:11:48,314 - INFO - Press CTRL+C to quit
2025-07-17 01:11:48,316 - INFO - * Restarting with stat
2025-07-17 01:11:53,049 - ERROR - Failed to bind to port 6001: [Errno 98] Address already in use
2025-07-17 01:11:53,099 - WARNING - * Debugger is active!
2025-07-17 01:11:53,100 - INFO - * Debugger PIN: 804-449-067