first commit

This commit is contained in:
2026-04-05 18:17:09 +07:00
commit 97109c2336
77 changed files with 2913 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# PHP-FPM для Laravel с расширениями под MySQL и Redis.
FROM php:8.3-fpm-bookworm
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
unzip \
libzip-dev \
libpng-dev \
libonig-dev \
libicu-dev \
&& docker-php-ext-install -j$(nproc) pdo_mysql zip intl opcache \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& rm -rf /var/lib/apt/lists/*
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
COPY docker/php/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["php-fpm"]
+27
View File
@@ -0,0 +1,27 @@
#!/bin/sh
set -e
cd /var/www/html
# Синхронизация Laravel .env с файлом конфигурации Docker (настройки — в файлах, не в ENV хоста).
if [ -f docker/app.env ]; then
cp docker/app.env .env
elif [ ! -f .env ] && [ -f docker/app.env.example ]; then
cp docker/app.env.example .env
fi
if [ ! -d vendor ] || [ ! -f vendor/autoload.php ]; then
composer install --no-interaction --prefer-dist --optimize-autoloader
fi
if [ -f artisan ]; then
mkdir -p storage/framework/{sessions,views,cache} storage/logs bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache 2>/dev/null || true
php artisan config:clear 2>/dev/null || true
if ! grep -q '^APP_KEY=.\{10,\}' .env 2>/dev/null; then
php artisan key:generate --force --ansi || true
fi
php artisan migrate --force --ansi
fi
exec "$@"