feat: initialize Infra Manager with React, Tailwind CSS, and Inertia.js
- Added main application entry point (app.jsx) and bootstrap file for React setup. - Created Wiki index page (Index.jsx) for documentation and file management. - Implemented utility functions for formatting and status handling in utils.js. - Set up Blade template (app.blade.php) for Inertia.js integration. - Defined API routes for metrics and terminal access in api.php. - Established console commands for scheduled tasks in console.php. - Created web routes for various application features including authentication, hypervisors, containers, cloud accounts, security, backups, and wiki management in web.php. - Developed setup scripts for Windows (setup.ps1) and Linux (setup.sh) environments. - Configured Tailwind CSS for styling with custom themes and animations in tailwind.config.js. - Set up Vite for asset bundling and development server in vite.config.js.
This commit is contained in:
92
docker/php/Dockerfile
Normal file
92
docker/php/Dockerfile
Normal file
@@ -0,0 +1,92 @@
|
||||
FROM php:8.3-fpm-alpine
|
||||
|
||||
LABEL maintainer="Infra Manager"
|
||||
|
||||
# Build arguments
|
||||
ARG NODE_VERSION=22
|
||||
ARG USER_ID=1000
|
||||
ARG GROUP_ID=1000
|
||||
|
||||
# Install system dependencies
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
git \
|
||||
icu-dev \
|
||||
libzip-dev \
|
||||
linux-headers \
|
||||
oniguruma-dev \
|
||||
openssl-dev \
|
||||
sqlite \
|
||||
sqlite-dev \
|
||||
supervisor \
|
||||
unzip \
|
||||
zip \
|
||||
libpng-dev \
|
||||
libjpeg-turbo-dev \
|
||||
freetype-dev \
|
||||
shadow \
|
||||
nodejs \
|
||||
npm
|
||||
|
||||
# Install PHP extensions
|
||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install \
|
||||
bcmath \
|
||||
exif \
|
||||
gd \
|
||||
intl \
|
||||
mbstring \
|
||||
opcache \
|
||||
pcntl \
|
||||
pdo \
|
||||
pdo_sqlite \
|
||||
zip
|
||||
|
||||
# Install pdo_mysql for later MySQL migration
|
||||
RUN apk add --no-cache mysql-client \
|
||||
&& docker-php-ext-install pdo_mysql
|
||||
|
||||
# Install Redis extension
|
||||
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
|
||||
&& pecl install redis \
|
||||
&& docker-php-ext-enable redis \
|
||||
&& apk del .build-deps
|
||||
|
||||
# Install Composer
|
||||
COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
# Configure opcache
|
||||
RUN docker-php-ext-enable opcache
|
||||
COPY docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
||||
|
||||
# PHP configuration
|
||||
COPY docker/php/php.ini /usr/local/etc/php/conf.d/custom.ini
|
||||
|
||||
# Create application user
|
||||
RUN addgroup -g ${GROUP_ID} appgroup 2>/dev/null || true \
|
||||
&& adduser -u ${USER_ID} -G appgroup -s /bin/bash -D appuser 2>/dev/null || true
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Copy application
|
||||
COPY --chown=appuser:appgroup . .
|
||||
|
||||
# Install PHP dependencies
|
||||
RUN composer install --no-dev --optimize-autoloader --no-interaction 2>/dev/null || \
|
||||
composer install --optimize-autoloader --no-interaction
|
||||
|
||||
# Install Node dependencies and build assets
|
||||
RUN npm ci && npm run build
|
||||
|
||||
# Set permissions
|
||||
RUN chown -R appuser:appgroup /var/www/html \
|
||||
&& chmod -R 755 /var/www/html/storage \
|
||||
&& chmod -R 755 /var/www/html/bootstrap/cache
|
||||
|
||||
USER appuser
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
CMD ["php-fpm"]
|
||||
8
docker/php/opcache.ini
Normal file
8
docker/php/opcache.ini
Normal file
@@ -0,0 +1,8 @@
|
||||
opcache.enable=1
|
||||
opcache.memory_consumption=256
|
||||
opcache.interned_strings_buffer=16
|
||||
opcache.max_accelerated_files=20000
|
||||
opcache.revalidate_freq=0
|
||||
opcache.validate_timestamps=0
|
||||
opcache.save_comments=1
|
||||
opcache.fast_shutdown=0
|
||||
7
docker/php/php.ini
Normal file
7
docker/php/php.ini
Normal file
@@ -0,0 +1,7 @@
|
||||
upload_max_filesize = 100M
|
||||
post_max_size = 100M
|
||||
memory_limit = 512M
|
||||
max_execution_time = 300
|
||||
max_input_vars = 5000
|
||||
date.timezone = UTC
|
||||
expose_php = Off
|
||||
Reference in New Issue
Block a user