Compare commits

..

No commits in common. "fdb3ac15c6c719ba48621554ec89b7f973a19635" and "f3f8b7fe04b34b8badbf7f31f473d8c5466b5b13" have entirely different histories.

6 changed files with 17 additions and 70 deletions

View File

@ -5,6 +5,3 @@ Dockerfile
docker-compose.yml
.git
.gitignore
tests
*.log
storage/logs/*

View File

@ -1,4 +1,4 @@
# Stage 1: Build Vue (tetap sama)
# Stage 1: Build Vue
FROM node:20 as node_builder
WORKDIR /app
COPY package*.json ./
@ -11,24 +11,19 @@ FROM php:8.3-fpm
RUN apt-get update && apt-get install -y \
git unzip libzip-dev libpng-dev libonig-dev libxml2-dev curl \
&& docker-php-ext-install pdo_mysql zip gd mbstring exif pcntl bcmath \
&& apt-get clean && rm -rf /var/lib/apt/lists/* # Cleanup untuk ukuran kecil
&& docker-php-ext-install pdo_mysql zip gd mbstring exif pcntl bcmath
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
# Copy source code
# Copy source code KECUALI public (biar ga ketiban build Vue)
COPY . .
# Copy hasil build Vue
# Copy hasil build Vue dari stage 1
COPY --from=node_builder /app/dist /var/www/html/public
RUN composer install --no-dev --optimize-autoloader
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/storage /var/www/html/bootstrap/cache
EXPOSE 9000
CMD ["php-fpm"]

View File

@ -276,13 +276,6 @@ php artisan backup:run
php artisan make:model ProductCategory -m
```
### Production
> Pastikan `.env.production` sudah ada.
```bash
docker compose --env-file .env.production up --build -d
```
---
## 📄 License

View File

@ -3,16 +3,16 @@ services:
build:
context: .
dockerfile: Dockerfile
container_name: laravel_app_prod
container_name: laravel_app
volumes:
- ./storage:/var/www/html/storage
- .:/var/www/html
command: php artisan serve --host=0.0.0.0 --port=8000
ports:
- "9000"
- "8000:8000"
depends_on:
- mysql
environment:
APP_ENV: production
APP_DEBUG: false
APP_ENV: local
APP_KEY: ${APP_KEY}
DB_CONNECTION: mysql
DB_HOST: mysql
@ -21,36 +21,19 @@ services:
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
nginx:
image: nginx:alpine
container_name: nginx_prod
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./storage:/var/www/html/storage:ro
depends_on:
- laravel
mysql:
image: mysql:8
container_name: mysql_db_prod
container_name: mysql_db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: laravel
MYSQL_USER: laravel
MYSQL_PASSWORD: laravel
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
redis:
image: redis:alpine
container_name: redis_prod
ports:
- "6379:6379"
volumes:
mysql_data:

View File

@ -1,21 +0,0 @@
server {
listen 80;
index index.php index.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html/public;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass laravel:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}

View File

@ -196,8 +196,8 @@ import logo_bni from '@/../images/logo_bni.png'
import logo_mastercard from '@/../images/logo_mastercard.png'
import logo_visa from '@/../images/logo_visa.png'
import logo_mandiri from '@/../images/logo_mandiri.png'
import inputField from '@/components/InputField.vue'
import inputSelect from '@/components/InputSelect.vue'
import inputField from '@/components/inputField.vue'
import inputSelect from '@/components/inputSelect.vue'
import axios from 'axios'