Merge branch 'development' of https://git.abbauf.com/Magang-2025/Kasir into development

This commit is contained in:
dhilanradya 2025-10-22 11:07:24 +07:00
commit 0bbbba4a11
4 changed files with 55 additions and 75 deletions

View File

@ -1,86 +1,65 @@
# ========================================
# Abbauf Kasir - Docker Environment Configuration
# ========================================
# Copy file ini ke .env sebelum deployment
# Ganti semua placeholder dengan nilai yang sesuai
# Application
APP_NAME=Abbauf-Kasir APP_NAME=Abbauf-Kasir
APP_ENV=production APP_ENV=local
APP_KEY= # Generate dengan: php artisan key:generate APP_KEY=
APP_DEBUG=false APP_DEBUG=true
APP_URL=http://localhost # Ganti dengan domain production APP_URL=http://localhost
APP_LOCALE=id APP_LOCALE=en
APP_FALLBACK_LOCALE=en APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=id_ID APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database
PHP_CLI_SERVER_WORKERS=4 PHP_CLI_SERVER_WORKERS=4
BCRYPT_ROUNDS=12 BCRYPT_ROUNDS=12
# Logging
LOG_CHANNEL=stack LOG_CHANNEL=stack
LOG_STACK=daily LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=error LOG_LEVEL=debug
# Database Configuration DB_CONNECTION=sqlite
DB_CONNECTION=mysql # DB_HOST=127.0.0.1
DB_HOST=mysql # Nama service di docker-compose # DB_PORT=3306
DB_PORT=3306 # DB_DATABASE=laravel
DB_DATABASE=kasir_db # Nama database # DB_USERNAME=root
DB_USERNAME=kasir_user # Username database # DB_PASSWORD=
DB_PASSWORD=strong_password_here # GANTI dengan password kuat!
# MySQL Root Password (untuk docker-compose) SESSION_DRIVER=database
MYSQL_ROOT_PASSWORD=root_strong_password # GANTI dengan password root yang kuat!
# Cache & Session
CACHE_STORE=redis
SESSION_DRIVER=redis
SESSION_LIFETIME=120 SESSION_LIFETIME=120
SESSION_ENCRYPT=false SESSION_ENCRYPT=false
SESSION_PATH=/ SESSION_PATH=/
SESSION_DOMAIN=null SESSION_DOMAIN=null
# Redis Configuration BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
CACHE_STORE=database
# CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis REDIS_CLIENT=phpredis
REDIS_HOST=redis REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
# Queue
QUEUE_CONNECTION=redis
# Broadcasting
BROADCAST_CONNECTION=log
# Filesystem
FILESYSTEM_DISK=local
# Mail Configuration (opsional)
MAIL_MAILER=log MAIL_MAILER=log
MAIL_SCHEME=null MAIL_SCHEME=null
MAIL_HOST=127.0.0.1 MAIL_HOST=127.0.0.1
MAIL_PORT=2525 MAIL_PORT=2525
MAIL_USERNAME=null MAIL_USERNAME=null
MAIL_PASSWORD=null MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="noreply@abbauf-kasir.local" MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}" MAIL_FROM_NAME="${APP_NAME}"
# AWS (jika menggunakan S3 untuk storage)
AWS_ACCESS_KEY_ID= AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY= AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1 AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET= AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false AWS_USE_PATH_STYLE_ENDPOINT=false
# Ports (untuk docker-compose) VITE_APP_NAME="${APP_NAME}"
APP_PORT=80 # Port untuk akses aplikasi
# DB_PORT=3306 # Uncomment jika ingin expose DB port
# REDIS_PORT=6379 # Uncomment jika ingin expose Redis port
# Vite
VITE_APP_NAME="${APP_NAME}"

View File

@ -142,7 +142,7 @@ docker compose --env-file .env.production up -d --build
docker exec -it abbauf_kasir_app php artisan migrate --seed docker exec -it abbauf_kasir_app php artisan migrate --seed
# Atau import database secara manual # Atau import database secara manual
docker exec -i abbauf_kasir_db mysql -u kasir_user -pkasir_password kasir_db < ./toko_emas.sql docker exec -i abbauf_kasir_db mysql -u kasir_user -pkasir_password kasir_db < ./storage/toko_emas.sql
# Periksa database (opsional) # Periksa database (opsional)
docker exec -it abbauf_kasir_db bash docker exec -it abbauf_kasir_db bash

View File

@ -1,4 +1,4 @@
version: '3.8' version: '3.9'
services: services:
# ======================================== # ========================================
@ -13,7 +13,7 @@ services:
working_dir: /var/www/html working_dir: /var/www/html
volumes: volumes:
# Mount storage untuk uploads dan logs (persistent) # Mount storage untuk uploads dan logs (persistent)
- ./storage:/var/www/html/storage - ./storage/app/public:/var/www/html/storage/app/public
# Mount public build assets (read-only) # Mount public build assets (read-only)
- ./public/build:/var/www/html/public/build:ro - ./public/build:/var/www/html/public/build:ro
environment: environment:
@ -47,11 +47,11 @@ services:
condition: service_started condition: service_started
networks: networks:
- kasir_network - kasir_network
healthcheck: # healthcheck:
test: ["CMD", "php-fpm", "-t"] # test: ["CMD", "php-fpm", "-t"]
interval: 30s # interval: 30s
timeout: 10s # timeout: 10s
retries: 3 # retries: 3
# ======================================== # ========================================
# Nginx Web Server # Nginx Web Server
@ -61,29 +61,30 @@ services:
container_name: abbauf_kasir_nginx container_name: abbauf_kasir_nginx
restart: unless-stopped restart: unless-stopped
ports: ports:
- "${APP_PORT:-80}:80" - "81:80"
volumes: volumes:
# Nginx configuration # Nginx configuration
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro - ./nginx.conf:/etc/nginx/conf.d/default.conf
# Laravel public directory (untuk static assets) # Laravel public directory (untuk static assets)
- ./public:/var/www/html/public:ro - ./public:/var/www/html/public
# Storage symlink untuk file uploads # Storage symlink untuk file uploads
- ./storage/app/public:/var/www/html/public/storage:ro - ./storage/app/public:/var/www/html/public/storage
depends_on: depends_on:
- laravel - laravel
networks: networks:
- kasir_network - kasir_network
healthcheck: # healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"] # test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"]
interval: 30s # interval: 30s
timeout: 10s # timeout: 10s
retries: 3 # retries: 3
# ======================================== # ========================================
# MySQL Database # MySQL Database
# ======================================== # ========================================
mysql: mysql:
image: mysql:8.4 # image: mysql:8.4
image: mariadb:10.6
container_name: abbauf_kasir_db container_name: abbauf_kasir_db
restart: unless-stopped restart: unless-stopped
environment: environment:
@ -94,7 +95,7 @@ services:
MYSQL_CHARACTER_SET_SERVER: utf8mb4 MYSQL_CHARACTER_SET_SERVER: utf8mb4
MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci
ports: ports:
- "${DB_PORT:-3306}:3306" - "3308:3306"
volumes: volumes:
- mysql_data:/var/lib/mysql - mysql_data:/var/lib/mysql
# Optional: backup folder # Optional: backup folder
@ -116,16 +117,16 @@ services:
container_name: abbauf_kasir_redis container_name: abbauf_kasir_redis
restart: unless-stopped restart: unless-stopped
ports: ports:
- "${REDIS_PORT:-6379}:6379" - "6380:6379"
volumes: volumes:
- redis_data:/data - redis_data:/data
networks: networks:
- kasir_network - kasir_network
healthcheck: # healthcheck:
test: ["CMD", "redis-cli", "ping"] # test: ["CMD", "redis-cli", "ping"]
interval: 10s # interval: 10s
timeout: 5s # timeout: 5s
retries: 3 # retries: 3
command: redis-server --appendonly yes command: redis-server --appendonly yes
# ======================================== # ========================================