[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)
|
## Installation
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
||||||
### 1. Clone Repository
|
### 1. Clone Repository
|
||||||
|
|
||||||
@ -151,8 +108,6 @@ DB_USERNAME=root
|
|||||||
DB_PASSWORD=
|
DB_PASSWORD=
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 5. Setup Database
|
### 5. Setup Database
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -180,12 +135,15 @@ npm run dev
|
|||||||
#### Production Mode
|
#### Production Mode
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build untuk production
|
# Pastikan env production sudah tersedia
|
||||||
npm run build
|
docker compose --env-file .env.production up -d --build
|
||||||
|
|
||||||
# Jalankan dengan web server (Apache/Nginx)
|
# Siapkan database
|
||||||
# atau gunakan PHP built-in server
|
docker exec -it abbauf_kasir_app php artisan migrate --seed
|
||||||
php artisan serve --host=0.0.0.0 --port=8000
|
|
||||||
|
# Periksa database (opsional)
|
||||||
|
docker exec -it abbauf_kasir_db bash
|
||||||
|
mysql -u root -p
|
||||||
```
|
```
|
||||||
|
|
||||||
### 8. Print Label
|
### 8. Print Label
|
||||||
@ -206,19 +164,18 @@ php artisan serve --host=0.0.0.0 --port=8000
|
|||||||
Setelah instalasi berhasil, akses aplikasi melalui:
|
Setelah instalasi berhasil, akses aplikasi melalui:
|
||||||
|
|
||||||
- **URL**: http://localhost:8000
|
- **URL**: http://localhost:8000
|
||||||
- **Admin Panel**: http://localhost:8000/admin (jika tersedia)
|
|
||||||
|
|
||||||
### 👤 Default Login
|
### 👤 Default Login
|
||||||
|
|
||||||
**Owner Account:**
|
**Owner Account:**
|
||||||
|
|
||||||
- Email: `owner@tokoperhiasan.com`
|
- Username: `admin`
|
||||||
- Password: `password123`
|
- Password: `123123`
|
||||||
|
|
||||||
**Kasir Account:**
|
**Kasir Account:**
|
||||||
|
|
||||||
- Email: `kasir@tokoperhiasan.com`
|
- Username: `kasir`
|
||||||
- Password: `password123`
|
- Password: `123123`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,6 @@ namespace Database\Seeders;
|
|||||||
use App\Models\Kategori;
|
use App\Models\Kategori;
|
||||||
use App\Models\Nampan;
|
use App\Models\Nampan;
|
||||||
use App\Models\Produk;
|
use App\Models\Produk;
|
||||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
class DataSeeder extends Seeder
|
class DataSeeder extends Seeder
|
||||||
@ -16,47 +15,60 @@ class DataSeeder extends Seeder
|
|||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
// Nampan
|
// Nampan
|
||||||
for ($i=0; $i < 30; $i++) {
|
for ($i = 0; $i < 30; $i++) {
|
||||||
if ($i != 12) {
|
if ($i != 12) {
|
||||||
Nampan::factory()->create([
|
Nampan::create([
|
||||||
'nama' => 'A' . ($i + 1)
|
'nama' => 'A' . ($i + 1),
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kategori
|
// Kategori
|
||||||
$kategoriList = ['Cincin', 'Gelang Rantai', 'Gelang Bulat', 'Kalung', 'Liontin', 'Anting', 'Giwang'];
|
$kategoriList = ['Cincin', 'Gelang Rantai', 'Gelang Bulat', 'Kalung', 'Liontin', 'Anting', 'Giwang'];
|
||||||
foreach ($kategoriList as $kategori) {
|
foreach ($kategoriList as $index => $kategori) {
|
||||||
Kategori::factory()->create([
|
Kategori::create([
|
||||||
'nama' => $kategori
|
'nama' => $kategori,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Produk
|
// Produk 1
|
||||||
$produk1 = Produk::factory()->create([
|
$produk1 = Produk::create([
|
||||||
'nama'=>'Gelang serut daun shimmer mp (mas putih)',
|
'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,
|
'berat' => 1.4,
|
||||||
'kadar'=>8,
|
'kadar' => 8,
|
||||||
'harga_per_gram'=>900000,
|
'harga_per_gram' => 900000,
|
||||||
'harga_jual'=>1260000,
|
'harga_jual' => 1260000,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
]);
|
]);
|
||||||
$produk1->foto()->create([
|
$produk1->foto()->create([
|
||||||
'id_produk'=>$produk1->id,
|
'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
|
||||||
'nama'=>'Gelang rantai 5 buah clover merah',
|
$produk2 = Produk::create([
|
||||||
'id_kategori'=>Kategori::find(2),
|
'nama' => 'Gelang rantai 5 buah clover merah',
|
||||||
'berat'=>3.6,
|
'id_kategori' => Kategori::where('nama', 'Gelang Rantai')->first()->id,
|
||||||
'kadar'=>8,
|
'berat' => 3.6,
|
||||||
'harga_per_gram'=>850000,
|
'kadar' => 8,
|
||||||
'harga_jual'=>3060000,
|
'harga_per_gram' => 850000,
|
||||||
|
'harga_jual' => 3060000,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
]);
|
]);
|
||||||
$produk2->foto()->create([
|
$produk2->foto()->create([
|
||||||
'id_produk'=>$produk2->id,
|
'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\Sales;
|
||||||
use App\Models\Transaksi;
|
use App\Models\Transaksi;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
class DatabaseSeeder extends Seeder
|
class DatabaseSeeder extends Seeder
|
||||||
{
|
{
|
||||||
@ -19,24 +19,35 @@ class DatabaseSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
User::factory()->create([
|
// Create admin user
|
||||||
|
User::create([
|
||||||
'nama' => 'admin',
|
'nama' => 'admin',
|
||||||
'role' => 'owner',
|
'role' => 'owner',
|
||||||
'password' => bcrypt('123123'),
|
'password' => Hash::make('123123'),
|
||||||
]);
|
'created_at' => now(),
|
||||||
User::factory()->create([
|
'updated_at' => now(),
|
||||||
'nama' => 'kasir',
|
|
||||||
'role' => 'kasir',
|
|
||||||
'password' => bcrypt('123123'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
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',
|
'nama' => 'Kasir',
|
||||||
'no_hp' => '-',
|
'no_hp' => '-',
|
||||||
'alamat' => '-',
|
'alamat' => '-',
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Call other seeders
|
||||||
$this->call(DataSeeder::class);
|
$this->call(DataSeeder::class);
|
||||||
// $this->call(DummySeeder::class);
|
// $this->call(DummySeeder::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ services:
|
|||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
command: --default-authentication-plugin=mysql_native_password
|
# command: --default-authentication-plugin=mysql_native_password
|
||||||
|
|
||||||
# ========================================
|
# ========================================
|
||||||
# Redis Cache & Session Store
|
# Redis Cache & Session Store
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user