[Update] Docker

This commit is contained in:
Baghaztra 2025-10-15 10:02:06 +07:00
parent b43b098936
commit e226faf08a
3 changed files with 23 additions and 16 deletions

View File

@ -1,12 +1,12 @@
APP_NAME=Abbauf-Kasir
APP_NAME=KasirTMJC
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8000
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_LOCALE=id
APP_FALLBACK_LOCALE=id
APP_FAKER_LOCALE=id_ID
APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database
@ -20,12 +20,15 @@ LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=kasir_db
DB_USERNAME=kasir_user
DB_PASSWORD=kasir_password
# MySQL Root Password (untuk Docker)
MYSQL_ROOT_PASSWORD=root_password
SESSION_DRIVER=database
SESSION_LIFETIME=120
@ -43,7 +46,7 @@ CACHE_STORE=database
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

View File

@ -24,11 +24,13 @@ COPY . .
COPY --from=node_builder /app/public/build /var/www/html/public/build
RUN composer install --no-dev --optimize-autoloader
RUN php artisan storage:link || true
RUN php artisan config:cache && php artisan route:cache && php artisan view:cache # Optimasi cache untuk performa laporan/transaksi
# Set permission dan user non-root
RUN chown -R www-data:www-data /var/www/html
USER www-data
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html/storage \
&& chmod -R 755 /var/www/html/bootstrap/cache
EXPOSE 9000
CMD ["php-fpm"]

View File

@ -5,7 +5,7 @@ services:
dockerfile: Dockerfile
container_name: laravel_app_prod
volumes:
- ./storage:/var/www/html/storage
- storage_data:/var/www/html/storage
ports:
- "9000"
depends_on:
@ -28,7 +28,8 @@ services:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./storage:/var/www/html/storage:ro
volumes_from:
- laravel:ro
depends_on:
- laravel
@ -54,3 +55,4 @@ services:
volumes:
mysql_data:
storage_data: