fix styling and try optimize dockerfile

This commit is contained in:
2025-07-14 14:33:39 +07:00
parent 96a9729a35
commit dff0f7ceba
5 changed files with 40 additions and 52 deletions

View File

@@ -9,7 +9,6 @@ RUN apt-get update && apt-get install -y \
curl \
libcurl4-openssl-dev \
pkg-config \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
@@ -47,39 +46,38 @@ RUN pecl install redis \
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy existing application directory contents
COPY . /var/www/html
# Copy only composer files first for caching
COPY composer.json composer.lock ./
# Copy existing application directory permissions
COPY --chown=www-data:www-data . /var/www/html
# Copy only npm files first for caching
COPY package.json package-lock.json ./
# Install PHP dependencies
# Now copy the full Laravel application code
COPY . .
# Install PHP dependencies (cached if lock file unchanged)
RUN composer install --optimize-autoloader --no-dev --no-interaction
# Install Node.js dependencies and build assets
RUN npm ci \
&& npm run production \
&& rm -rf node_modules
RUN npm ci && npm run production && rm -rf node_modules
# Create necessary directories and set permissions
RUN mkdir -p /var/www/html/storage/logs \
&& mkdir -p /var/www/html/storage/framework/cache \
&& mkdir -p /var/www/html/storage/framework/sessions \
&& mkdir -p /var/www/html/storage/framework/views \
&& mkdir -p /var/www/html/storage/app \
&& mkdir -p /var/www/html/bootstrap/cache \
# Set proper permissions (for production only do this once)
RUN mkdir -p storage/logs \
&& mkdir -p storage/framework/{cache,sessions,views} \
&& mkdir -p storage/app \
&& mkdir -p bootstrap/cache \
&& chown -R www-data:www-data /var/www/html \
&& chmod -R 775 /var/www/html/storage \
&& chmod -R 775 /var/www/html/bootstrap/cache \
&& chmod -R 755 /var/www/html/public
&& chmod -R 775 storage \
&& chmod -R 775 bootstrap/cache \
&& chmod -R 755 public
# Create nginx config
# Nginx config
COPY ./docker/nginx.conf /etc/nginx/sites-available/default
# Create supervisor config
# Supervisor config
COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Expose port 9000 and start php-fpm server
# Expose web port
EXPOSE 80
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

View File

@@ -17,7 +17,6 @@ RUN apt-get update && apt-get install -y \
unzip \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libxpm-dev \
libvpx-dev \
supervisor \
@@ -43,47 +42,41 @@ RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-xpm \
dom \
xml
# Install Redis and Xdebug for development
# Install Redis and Xdebug
RUN pecl install redis xdebug \
&& docker-php-ext-enable redis xdebug
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy existing application directory contents
COPY . /var/www/html
# Copy dependency files first for better caching
COPY composer.json composer.lock ./
COPY package.json package-lock.json ./
# Copy existing application directory permissions
COPY --chown=www-data:www-data . /var/www/html
# Now copy the entire application code (after npm/composer install)
COPY . .
# Install PHP dependencies with dev packages
RUN composer install --optimize-autoloader --no-interaction
# Install PHP dependencies (with dev)
RUN composer install --no-interaction
# Install Node.js dependencies
# Install Node dependencies (cached if package-lock.json not changed)
RUN npm install
# Create necessary directories and set permissions
RUN mkdir -p /var/www/html/storage/logs \
&& mkdir -p /var/www/html/storage/framework/cache \
&& mkdir -p /var/www/html/storage/framework/sessions \
&& mkdir -p /var/www/html/storage/framework/views \
&& mkdir -p /var/www/html/storage/app \
&& mkdir -p /var/www/html/bootstrap/cache \
# Set ownership and permissions
RUN mkdir -p storage/logs \
&& mkdir -p storage/framework/{cache,sessions,views} \
&& mkdir -p storage/app \
&& mkdir -p bootstrap/cache \
&& chown -R www-data:www-data /var/www/html \
&& chmod -R 775 /var/www/html/storage \
&& chmod -R 775 /var/www/html/bootstrap/cache \
&& chmod -R 755 /var/www/html/public
&& chmod -R 775 storage bootstrap/cache \
&& chmod -R 755 public
# Create nginx config for development
# Copy configs
COPY ./docker/nginx.dev.conf /etc/nginx/sites-available/default
# Create supervisor config for development
COPY ./docker/supervisord.dev.conf /etc/supervisor/conf.d/supervisord.conf
# Create Xdebug config
COPY ./docker/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# Expose ports
# Expose web port + possible Webpack/Vite
EXPOSE 80 3000
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

View File

@@ -293,7 +293,6 @@ use Illuminate\Support\Facades\Auth;
/* Service Advisor required styling */
select[name="user_sa_id"][required] option:first-child {
color: #6c757d;
font-style: italic;
}
/* Required field labels */

View File

@@ -48,7 +48,6 @@
.form-control {
border: 2px solid #e9ecef;
border-radius: 8px;
padding: 12px 15px;
font-size: 14px;
transition: all 0.3s ease;
}

View File

@@ -48,7 +48,6 @@
.form-control {
border: 2px solid #e9ecef;
border-radius: 8px;
padding: 12px 15px;
font-size: 14px;
transition: all 0.3s ease;
}