fix styling and try optimize dockerfile
This commit is contained in:
42
Dockerfile
42
Dockerfile
@@ -9,7 +9,6 @@ RUN apt-get update && apt-get install -y \
|
|||||||
curl \
|
curl \
|
||||||
libcurl4-openssl-dev \
|
libcurl4-openssl-dev \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
libpng-dev \
|
|
||||||
libonig-dev \
|
libonig-dev \
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
libzip-dev \
|
libzip-dev \
|
||||||
@@ -47,39 +46,38 @@ RUN pecl install redis \
|
|||||||
# Install Composer
|
# Install Composer
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
# Copy existing application directory contents
|
# Copy only composer files first for caching
|
||||||
COPY . /var/www/html
|
COPY composer.json composer.lock ./
|
||||||
|
|
||||||
# Copy existing application directory permissions
|
# Copy only npm files first for caching
|
||||||
COPY --chown=www-data:www-data . /var/www/html
|
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
|
RUN composer install --optimize-autoloader --no-dev --no-interaction
|
||||||
|
|
||||||
# Install Node.js dependencies and build assets
|
# Install Node.js dependencies and build assets
|
||||||
RUN npm ci \
|
RUN npm ci && npm run production && rm -rf node_modules
|
||||||
&& npm run production \
|
|
||||||
&& rm -rf node_modules
|
|
||||||
|
|
||||||
# Create necessary directories and set permissions
|
# Set proper permissions (for production only do this once)
|
||||||
RUN mkdir -p /var/www/html/storage/logs \
|
RUN mkdir -p storage/logs \
|
||||||
&& mkdir -p /var/www/html/storage/framework/cache \
|
&& mkdir -p storage/framework/{cache,sessions,views} \
|
||||||
&& mkdir -p /var/www/html/storage/framework/sessions \
|
&& mkdir -p storage/app \
|
||||||
&& mkdir -p /var/www/html/storage/framework/views \
|
&& mkdir -p bootstrap/cache \
|
||||||
&& mkdir -p /var/www/html/storage/app \
|
|
||||||
&& mkdir -p /var/www/html/bootstrap/cache \
|
|
||||||
&& chown -R www-data:www-data /var/www/html \
|
&& chown -R www-data:www-data /var/www/html \
|
||||||
&& chmod -R 775 /var/www/html/storage \
|
&& chmod -R 775 storage \
|
||||||
&& chmod -R 775 /var/www/html/bootstrap/cache \
|
&& chmod -R 775 bootstrap/cache \
|
||||||
&& chmod -R 755 /var/www/html/public
|
&& chmod -R 755 public
|
||||||
|
|
||||||
# Create nginx config
|
# Nginx config
|
||||||
COPY ./docker/nginx.conf /etc/nginx/sites-available/default
|
COPY ./docker/nginx.conf /etc/nginx/sites-available/default
|
||||||
|
|
||||||
# Create supervisor config
|
# Supervisor config
|
||||||
COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
|
||||||
# Expose port 9000 and start php-fpm server
|
# Expose web port
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||||
@@ -17,7 +17,6 @@ RUN apt-get update && apt-get install -y \
|
|||||||
unzip \
|
unzip \
|
||||||
libfreetype6-dev \
|
libfreetype6-dev \
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
libpng-dev \
|
|
||||||
libxpm-dev \
|
libxpm-dev \
|
||||||
libvpx-dev \
|
libvpx-dev \
|
||||||
supervisor \
|
supervisor \
|
||||||
@@ -43,47 +42,41 @@ RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-xpm \
|
|||||||
dom \
|
dom \
|
||||||
xml
|
xml
|
||||||
|
|
||||||
# Install Redis and Xdebug for development
|
# Install Redis and Xdebug
|
||||||
RUN pecl install redis xdebug \
|
RUN pecl install redis xdebug \
|
||||||
&& docker-php-ext-enable redis xdebug
|
&& docker-php-ext-enable redis xdebug
|
||||||
|
|
||||||
# Install Composer
|
# Install Composer
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
# Copy existing application directory contents
|
# Copy dependency files first for better caching
|
||||||
COPY . /var/www/html
|
COPY composer.json composer.lock ./
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
|
||||||
# Copy existing application directory permissions
|
# Now copy the entire application code (after npm/composer install)
|
||||||
COPY --chown=www-data:www-data . /var/www/html
|
COPY . .
|
||||||
|
|
||||||
# Install PHP dependencies with dev packages
|
# Install PHP dependencies (with dev)
|
||||||
RUN composer install --optimize-autoloader --no-interaction
|
RUN composer install --no-interaction
|
||||||
|
|
||||||
# Install Node.js dependencies
|
# Install Node dependencies (cached if package-lock.json not changed)
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Create necessary directories and set permissions
|
# Set ownership and permissions
|
||||||
RUN mkdir -p /var/www/html/storage/logs \
|
RUN mkdir -p storage/logs \
|
||||||
&& mkdir -p /var/www/html/storage/framework/cache \
|
&& mkdir -p storage/framework/{cache,sessions,views} \
|
||||||
&& mkdir -p /var/www/html/storage/framework/sessions \
|
&& mkdir -p storage/app \
|
||||||
&& mkdir -p /var/www/html/storage/framework/views \
|
&& mkdir -p bootstrap/cache \
|
||||||
&& mkdir -p /var/www/html/storage/app \
|
|
||||||
&& mkdir -p /var/www/html/bootstrap/cache \
|
|
||||||
&& chown -R www-data:www-data /var/www/html \
|
&& chown -R www-data:www-data /var/www/html \
|
||||||
&& chmod -R 775 /var/www/html/storage \
|
&& chmod -R 775 storage bootstrap/cache \
|
||||||
&& chmod -R 775 /var/www/html/bootstrap/cache \
|
&& chmod -R 755 public
|
||||||
&& chmod -R 755 /var/www/html/public
|
|
||||||
|
|
||||||
# Create nginx config for development
|
# Copy configs
|
||||||
COPY ./docker/nginx.dev.conf /etc/nginx/sites-available/default
|
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
|
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
|
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
|
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"]
|
||||||
@@ -293,7 +293,6 @@ use Illuminate\Support\Facades\Auth;
|
|||||||
/* Service Advisor required styling */
|
/* Service Advisor required styling */
|
||||||
select[name="user_sa_id"][required] option:first-child {
|
select[name="user_sa_id"][required] option:first-child {
|
||||||
color: #6c757d;
|
color: #6c757d;
|
||||||
font-style: italic;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Required field labels */
|
/* Required field labels */
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
.form-control {
|
.form-control {
|
||||||
border: 2px solid #e9ecef;
|
border: 2px solid #e9ecef;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 12px 15px;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
.form-control {
|
.form-control {
|
||||||
border: 2px solid #e9ecef;
|
border: 2px solid #e9ecef;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 12px 15px;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user