Refactor Docker setup for Laravel 5.0 compatibility and optimize deployment process
- Updated Dockerfile configurations for various environments (alpine, basic, cloudrun, minimal, simple, test) to ensure compatibility with Laravel 5.0 and PHP 5.6. - Added PHP compatibility documentation outlining mcrypt requirements and upgrade paths. - Created cloudbuild.yaml for Google Cloud Build integration to streamline deployment to Cloud Run. - Introduced docker-compose.local.yml for local development with MySQL and Redis services. - Enhanced rebuild.sh script for easier local development and migration handling. - Updated Laravel Blade views to correct asset paths. - Added start-local.sh script for quick local setup and service management.
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -11,29 +11,23 @@ RUN apk --update --no-cache add \
|
||||
zip \
|
||||
unzip \
|
||||
libmcrypt-dev \
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
|
||||
&& docker-php-ext-install gd pdo pdo_mysql zip mcrypt
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /var/www
|
||||
|
||||
# Clear cache
|
||||
# RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy the Laravel application files to the container
|
||||
COPY . .
|
||||
|
||||
# Set appropriate permissions for Laravel storage and bootstrap cache
|
||||
RUN chown -R www-data:www-data storage bootstrap
|
||||
RUN chown -R www-data:www-data storage bootstrap/cache
|
||||
|
||||
# Install Composer
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
# Install Laravel dependencies
|
||||
RUN composer install --no-plugins --no-scripts
|
||||
|
||||
# Generate Laravel application key
|
||||
RUN php artisan key:generate
|
||||
RUN composer install --no-interaction --no-plugins --no-scripts
|
||||
|
||||
# Create directory for the socket and set permissions
|
||||
RUN mkdir -p /run/php && chown www-data:www-data /run/php
|
||||
|
||||
Reference in New Issue
Block a user