Skip to content

Commit

Permalink
perf: base on laravel docker
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkcup committed Apr 28, 2021
1 parent 548d9c8 commit 56f7400
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 56f7400

Please sign in to comment.