This commit is contained in:
Saufi
2026-06-03 09:11:52 +08:00
parent a14d43fe34
commit 75d046228b
6 changed files with 116 additions and 1 deletions

View File

@@ -10,7 +10,9 @@
"Bash(del \"c:\\\\Users\\\\User\\\\Aplikasi\\\\prn2026\\\\app\\\\Http\\\\Requests\\\\Admin\\\\Setup\\\\UpdateElectionSettingsRequest.php\")",
"Bash(Get-ChildItem -Path \"c:\\\\Users\\\\User\\\\Aplikasi\\\\prn2026\\\\app\\\\Http\\\\Controllers\" -Recurse -Filter \"*Application*\")",
"Bash(Select-Object -ExpandProperty FullName)",
"PowerShell(cd c:\\\\Users\\\\User\\\\Aplikasi\\\\prn2026; git add . 2>&1 | Select-Object -First 5; Write-Host \"Exit: $LASTEXITCODE\")"
"PowerShell(cd c:\\\\Users\\\\User\\\\Aplikasi\\\\prn2026; git add . 2>&1 | Select-Object -First 5; Write-Host \"Exit: $LASTEXITCODE\")",
"PowerShell(New-Item -ItemType Directory -Force \"c:\\\\Users\\\\User\\\\Aplikasi\\\\prn2026\\\\docker\\\\php-apache\")",
"PowerShell(New-Item -ItemType Directory -Force \"c:\\\\Users\\\\User\\\\Aplikasi\\\\prn2026\\\\docker\\\\php\")"
],
"additionalDirectories": [
"c:\\Users\\User\\.claude\\projects\\c--Users-User-Aplikasi-prn2026\\memory"

15
.env.docker Normal file
View File

@@ -0,0 +1,15 @@
APP_URL=http://localhost:8000
DB_CONNECTION=mysql
DB_HOST=172.17.20.16
DB_PORT=3306
DB_DATABASE=prn2026
DB_USERNAME=root
DB_PASSWORD=1234
REDIS_HOST=redis
REDIS_PORT=6379
SESSION_DRIVER=database
QUEUE_CONNECTION=database
CACHE_STORE=redis

42
docker-compose.yml Normal file
View File

@@ -0,0 +1,42 @@
services:
app:
build:
context: .
dockerfile: docker/php-apache/Dockerfile
container_name: prn2026-app
ports:
- "8000:80"
volumes:
- .:/var/www/html
- ./docker/php/custom.ini:/usr/local/etc/php/conf.d/99-custom.ini
- vendor_cache:/var/www/html/vendor
- node_modules_cache:/var/www/html/node_modules
environment:
APACHE_DOCUMENT_ROOT: /var/www/html/public
APP_ENV: local
APP_DEBUG: "true"
DB_HOST: 172.17.20.16
DB_PORT: 3306
DB_DATABASE: prn2026
DB_USERNAME: root
DB_PASSWORD: "1234"
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
- redis
extra_hosts:
- "host.docker.internal:host-gateway"
redis:
image: redis:7-alpine
container_name: prn2026-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
volumes:
redis_data:
vendor_cache:
node_modules_cache:

View File

@@ -0,0 +1,35 @@
FROM php:8.3-apache
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
# System dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
unzip \
libzip-dev \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libicu-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo_mysql gd intl zip pcntl \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& a2enmod rewrite headers \
&& rm -rf /var/lib/apt/lists/*
# Node.js 22 LTS (for npm / vite)
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Apache vhost
COPY docker/php-apache/vhost.conf /etc/apache2/sites-available/000-default.conf
WORKDIR /var/www/html
RUN chown -R www-data:www-data /var/www/html

View File

@@ -0,0 +1,13 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/public
<Directory /var/www/html/public>
AllowOverride All
Require all granted
Options -Indexes
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

8
docker/php/custom.ini Normal file
View File

@@ -0,0 +1,8 @@
display_errors = On
display_startup_errors = Off
log_errors = On
error_reporting = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED
upload_max_filesize = 20M
post_max_size = 25M
max_execution_time = 120
memory_limit = 256M