generated from theradcoza/Laravel-Docker-Dev-Template
Initial commit
This commit is contained in:
9
docker/mysql/my.cnf
Normal file
9
docker/mysql/my.cnf
Normal file
@@ -0,0 +1,9 @@
|
||||
[mysqld]
|
||||
general_log = 1
|
||||
general_log_file = /var/lib/mysql/general.log
|
||||
character-set-server = utf8mb4
|
||||
collation-server = utf8mb4_unicode_ci
|
||||
default-authentication-plugin = mysql_native_password
|
||||
|
||||
[client]
|
||||
default-character-set = utf8mb4
|
||||
42
docker/nginx/default.conf
Normal file
42
docker/nginx/default.conf
Normal file
@@ -0,0 +1,42 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
root /var/www/html/public;
|
||||
|
||||
add_header X-Frame-Options "SAMEORIGIN";
|
||||
add_header X-Content-Type-Options "nosniff";
|
||||
|
||||
index index.php;
|
||||
|
||||
charset utf-8;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
|
||||
error_page 404 /index.php;
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass app:9000;
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
fastcgi_hide_header X-Powered-By;
|
||||
}
|
||||
|
||||
location ~ /\.(?!well-known).* {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript;
|
||||
gzip_disable "MSIE [1-6]\.";
|
||||
|
||||
client_max_body_size 100M;
|
||||
}
|
||||
57
docker/php/Dockerfile
Normal file
57
docker/php/Dockerfile
Normal file
@@ -0,0 +1,57 @@
|
||||
FROM php:8.3-fpm
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
curl \
|
||||
libpng-dev \
|
||||
libonig-dev \
|
||||
libxml2-dev \
|
||||
libzip-dev \
|
||||
libpq-dev \
|
||||
libicu-dev \
|
||||
zip \
|
||||
unzip \
|
||||
supervisor \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install PHP extensions
|
||||
RUN docker-php-ext-configure intl \
|
||||
&& docker-php-ext-install \
|
||||
pdo_mysql \
|
||||
pdo_pgsql \
|
||||
mbstring \
|
||||
exif \
|
||||
pcntl \
|
||||
bcmath \
|
||||
gd \
|
||||
zip \
|
||||
intl \
|
||||
opcache
|
||||
|
||||
# Install Redis extension
|
||||
RUN pecl install redis && docker-php-ext-enable redis
|
||||
|
||||
# Install Composer
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
# Create system user to run Composer and Artisan commands
|
||||
RUN useradd -G www-data,root -u 1000 -d /home/devuser devuser
|
||||
RUN mkdir -p /home/devuser/.composer && \
|
||||
chown -R devuser:devuser /home/devuser
|
||||
|
||||
# Copy existing application directory permissions
|
||||
COPY --chown=devuser:devuser ./src /var/www/html
|
||||
|
||||
# Set proper permissions
|
||||
RUN chown -R devuser:www-data /var/www/html \
|
||||
&& chmod -R 775 /var/www/html/storage 2>/dev/null || true \
|
||||
&& chmod -R 775 /var/www/html/bootstrap/cache 2>/dev/null || true
|
||||
|
||||
USER devuser
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["php-fpm"]
|
||||
21
docker/php/local.ini
Normal file
21
docker/php/local.ini
Normal file
@@ -0,0 +1,21 @@
|
||||
; PHP Configuration for Development
|
||||
|
||||
upload_max_filesize = 100M
|
||||
post_max_size = 100M
|
||||
max_execution_time = 600
|
||||
memory_limit = 512M
|
||||
|
||||
; Error reporting
|
||||
display_errors = On
|
||||
display_startup_errors = On
|
||||
error_reporting = E_ALL
|
||||
|
||||
; Opcache settings - ENABLED for performance (even in dev on Windows/WSL2)
|
||||
opcache.enable = 1
|
||||
opcache.enable_cli = 0
|
||||
opcache.memory_consumption = 256
|
||||
opcache.interned_strings_buffer = 16
|
||||
opcache.max_accelerated_files = 20000
|
||||
opcache.validate_timestamps = 1
|
||||
opcache.revalidate_freq = 2
|
||||
opcache.fast_shutdown = 1
|
||||
Reference in New Issue
Block a user