intial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
server {
|
||||
listen 80;
|
||||
root /var/www/public;
|
||||
index index.php index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php-fpm:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
FROM node:16-alpine AS node-builder
|
||||
WORKDIR /build
|
||||
COPY package.json package-lock.json tailwind.config.js webpack.mix.js ./
|
||||
RUN npm install
|
||||
COPY resources/ resources/
|
||||
RUN npm run production
|
||||
|
||||
FROM php:8.1-fpm-alpine
|
||||
|
||||
RUN apk add --no-cache \
|
||||
git unzip libpng libwebp libjpeg libxpm libxml2 \
|
||||
&& docker-php-ext-install bcmath gd mbstring pdo_mysql xml
|
||||
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
WORKDIR /var/www
|
||||
|
||||
COPY . .
|
||||
|
||||
COPY --from=node-builder /build/public/css /var/www/public/css
|
||||
COPY --from=node-builder /build/public/js /var/www/public/js
|
||||
COPY --from=node-builder /build/public/mix-manifest.json /var/www/public/mix-manifest.json
|
||||
|
||||
RUN composer install --no-dev --optimize-autoloader && \
|
||||
chmod -R 775 storage bootstrap/cache && \
|
||||
chown -R www-data:www-data storage bootstrap/cache public/img
|
||||
|
||||
COPY .docker/php/entrypoint.sh /entrypoint.sh
|
||||
COPY .docker/php/php.ini /usr/local/etc/php/conf.d/custom.ini
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 9000
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "Waiting for database connection..."
|
||||
until php -r "try { new PDO('mysql:host=${DB_HOST};port=${DB_PORT}', '${DB_USERNAME}', '${DB_PASSWORD}'); echo 'ok'; } catch(PDOException \$e) { echo \$e->getMessage(); exit(1); }" 2>/dev/null | grep -q 'ok'; do
|
||||
sleep 3
|
||||
done
|
||||
echo "Database connected."
|
||||
|
||||
php artisan migrate --force --isolated
|
||||
php artisan storage:link --force || true
|
||||
|
||||
if [ "${APP_ENV}" = "production" ]; then
|
||||
php artisan config:cache
|
||||
php artisan route:cache
|
||||
php artisan view:cache
|
||||
fi
|
||||
|
||||
exec php-fpm
|
||||
@@ -0,0 +1,4 @@
|
||||
upload_max_filesize = 20M
|
||||
post_max_size = 20M
|
||||
memory_limit = 256M
|
||||
max_execution_time = 300
|
||||
Reference in New Issue
Block a user