[Update] Docker
This commit is contained in:
parent
0dc0cb365f
commit
42de65fc6b
69
README.md
69
README.md
@ -66,50 +66,7 @@ Semuah sistem Point of Sale (POS) yang dirancang khusus untuk kebutuhan toko per
|
||||
|
||||
---
|
||||
|
||||
## <20> Docker Installation (Recommended)
|
||||
|
||||
### Quick Start dengan Docker
|
||||
|
||||
```bash
|
||||
# 1. Clone repository
|
||||
git clone https://git.abbauf.com/Magang-2025/Kasir.git
|
||||
cd Kasir
|
||||
|
||||
# 2. Setup environment
|
||||
copy .env.docker .env # Windows
|
||||
# atau
|
||||
cp .env.docker .env # Linux/Mac
|
||||
|
||||
# 3. Edit .env (PENTING: ganti password!)
|
||||
notepad .env # Windows
|
||||
nano .env # Linux/Mac
|
||||
|
||||
# 4. Deploy dengan satu command
|
||||
docker-deploy.bat # Windows
|
||||
# atau
|
||||
./docker-deploy.sh # Linux/Mac
|
||||
|
||||
# 5. Akses aplikasi
|
||||
# http://localhost
|
||||
```
|
||||
|
||||
**Dokumentasi Docker Lengkap:**
|
||||
- 📖 Quick Start: [README-DOCKER.md](README-DOCKER.md)
|
||||
- 📚 Full Guide: [DOCKER-DEPLOYMENT.md](DOCKER-DEPLOYMENT.md)
|
||||
- 📋 Checklist: [DEPLOYMENT-CHECKLIST.md](DEPLOYMENT-CHECKLIST.md)
|
||||
- 🎯 Quick Reference: [QUICK-REFERENCE.txt](QUICK-REFERENCE.txt)
|
||||
|
||||
**Management Commands:**
|
||||
```bash
|
||||
docker-helper.bat status # Cek status containers
|
||||
docker-helper.bat logs # Lihat logs
|
||||
docker-helper.bat backup # Backup database
|
||||
docker-helper.bat restart # Restart containers
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## <20>🔧 Manual Installation
|
||||
## Installation
|
||||
|
||||
### 1. Clone Repository
|
||||
|
||||
@ -151,8 +108,6 @@ DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 5. Setup Database
|
||||
|
||||
```bash
|
||||
@ -180,12 +135,15 @@ npm run dev
|
||||
#### Production Mode
|
||||
|
||||
```bash
|
||||
# Build untuk production
|
||||
npm run build
|
||||
# Pastikan env production sudah tersedia
|
||||
docker compose --env-file .env.production up -d --build
|
||||
|
||||
# Jalankan dengan web server (Apache/Nginx)
|
||||
# atau gunakan PHP built-in server
|
||||
php artisan serve --host=0.0.0.0 --port=8000
|
||||
# Siapkan database
|
||||
docker exec -it abbauf_kasir_app php artisan migrate --seed
|
||||
|
||||
# Periksa database (opsional)
|
||||
docker exec -it abbauf_kasir_db bash
|
||||
mysql -u root -p
|
||||
```
|
||||
|
||||
### 8. Print Label
|
||||
@ -206,19 +164,18 @@ php artisan serve --host=0.0.0.0 --port=8000
|
||||
Setelah instalasi berhasil, akses aplikasi melalui:
|
||||
|
||||
- **URL**: http://localhost:8000
|
||||
- **Admin Panel**: http://localhost:8000/admin (jika tersedia)
|
||||
|
||||
### 👤 Default Login
|
||||
|
||||
**Owner Account:**
|
||||
|
||||
- Email: `owner@tokoperhiasan.com`
|
||||
- Password: `password123`
|
||||
- Username: `admin`
|
||||
- Password: `123123`
|
||||
|
||||
**Kasir Account:**
|
||||
|
||||
- Email: `kasir@tokoperhiasan.com`
|
||||
- Password: `password123`
|
||||
- Username: `kasir`
|
||||
- Password: `123123`
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -5,7 +5,6 @@ namespace Database\Seeders;
|
||||
use App\Models\Kategori;
|
||||
use App\Models\Nampan;
|
||||
use App\Models\Produk;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DataSeeder extends Seeder
|
||||
@ -18,45 +17,58 @@ class DataSeeder extends Seeder
|
||||
// Nampan
|
||||
for ($i = 0; $i < 30; $i++) {
|
||||
if ($i != 12) {
|
||||
Nampan::factory()->create([
|
||||
'nama' => 'A' . ($i + 1)
|
||||
Nampan::create([
|
||||
'nama' => 'A' . ($i + 1),
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// Kategori
|
||||
$kategoriList = ['Cincin', 'Gelang Rantai', 'Gelang Bulat', 'Kalung', 'Liontin', 'Anting', 'Giwang'];
|
||||
foreach ($kategoriList as $kategori) {
|
||||
Kategori::factory()->create([
|
||||
'nama' => $kategori
|
||||
foreach ($kategoriList as $index => $kategori) {
|
||||
Kategori::create([
|
||||
'nama' => $kategori,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
|
||||
// Produk
|
||||
$produk1 = Produk::factory()->create([
|
||||
// Produk 1
|
||||
$produk1 = Produk::create([
|
||||
'nama' => 'Gelang serut daun shimmer mp (mas putih)',
|
||||
'id_kategori'=>Kategori::find(2),
|
||||
'id_kategori' => Kategori::where('nama', 'Gelang Rantai')->first()->id,
|
||||
'berat' => 1.4,
|
||||
'kadar' => 8,
|
||||
'harga_per_gram' => 900000,
|
||||
'harga_jual' => 1260000,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
$produk1->foto()->create([
|
||||
'id_produk' => $produk1->id,
|
||||
'url'=>'https://i.imgur.com/eGYHzvw.jpeg'
|
||||
'url' => 'https://i.imgur.com/eGYHzvw.jpeg',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
$produk2 = Produk::factory()->create([
|
||||
// Produk 2
|
||||
$produk2 = Produk::create([
|
||||
'nama' => 'Gelang rantai 5 buah clover merah',
|
||||
'id_kategori'=>Kategori::find(2),
|
||||
'id_kategori' => Kategori::where('nama', 'Gelang Rantai')->first()->id,
|
||||
'berat' => 3.6,
|
||||
'kadar' => 8,
|
||||
'harga_per_gram' => 850000,
|
||||
'harga_jual' => 3060000,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
$produk2->foto()->create([
|
||||
'id_produk' => $produk2->id,
|
||||
'url'=>'https://i.imgur.com/UjQzYoE.jpeg'
|
||||
'url' => 'https://i.imgur.com/UjQzYoE.jpeg',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,8 +9,8 @@ use App\Models\Produk;
|
||||
use App\Models\Sales;
|
||||
use App\Models\Transaksi;
|
||||
use App\Models\User;
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
@ -19,23 +19,34 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
User::factory()->create([
|
||||
// Create admin user
|
||||
User::create([
|
||||
'nama' => 'admin',
|
||||
'role' => 'owner',
|
||||
'password' => bcrypt('123123'),
|
||||
]);
|
||||
User::factory()->create([
|
||||
'nama' => 'kasir',
|
||||
'role' => 'kasir',
|
||||
'password' => bcrypt('123123'),
|
||||
'password' => Hash::make('123123'),
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
Sales::factory()->create([
|
||||
// Create kasir user
|
||||
User::create([
|
||||
'nama' => 'kasir',
|
||||
'role' => 'kasir',
|
||||
'password' => Hash::make('123123'),
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
// Create sales record
|
||||
Sales::create([
|
||||
'nama' => 'Kasir',
|
||||
'no_hp' => '-',
|
||||
'alamat' => '-',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
// Call other seeders
|
||||
$this->call(DataSeeder::class);
|
||||
// $this->call(DummySeeder::class);
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ services:
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
# command: --default-authentication-plugin=mysql_native_password
|
||||
|
||||
# ========================================
|
||||
# Redis Cache & Session Store
|
||||
|
||||
Loading…
Reference in New Issue
Block a user