From 56f7400f6fc8d1d199762038718450ae1fc1154c Mon Sep 17 00:00:00 2001 From: sinkcup Date: Wed, 28 Apr 2021 22:02:38 +0800 Subject: [PATCH] perf: base on laravel docker --- Dockerfile | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index f6b1342..e10ac94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,41 +1,20 @@ -FROM php:8.0-apache +FROM laravelfans/laravel:6 -WORKDIR /var/www/laravel - -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \ +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \ && apt-get install -y \ - cron \ - icu-devtools \ - jq \ - libfreetype6-dev libicu-dev libjpeg62-turbo-dev libpng-dev libsasl2-dev libssl-dev libwebp-dev libxpm-dev libzip-dev \ nodejs \ - unzip \ - zlib1g-dev \ && apt-get clean \ && apt-get autoclean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \ - && yes '' | pecl install redis \ - && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm \ - && docker-php-ext-install gd intl pdo_mysql zip \ - && docker-php-ext-enable opcache redis - -COPY composer.json composer.lock ./ -RUN composer install --no-autoloader --no-scripts --no-dev +COPY docker/etc /etc/ -COPY package.json package-lock.json /var/www/laravel/ +COPY package.json package-lock.json ./ RUN npm install -COPY docker/ / -RUN a2enmod rewrite headers \ - && a2ensite laravel \ - && a2dissite 000-default \ - && chmod +x /usr/local/bin/docker-laravel-entrypoint +COPY composer.json composer.lock ./ +RUN composer install --no-autoloader --no-scripts --no-dev COPY . /var/www/laravel RUN composer install --optimize-autoloader --no-dev \ && npm run production - -CMD ["docker-laravel-entrypoint"]