Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .docker/php/opcache.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
opcache.enable=1
opcache.file_cache='/tmp/opcache'
opcache.file_update_protection=0
40 changes: 28 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
FROM composer:1.8 AS composer
FROM php:7.4-cli as rector
WORKDIR /rector

# Install php extensions
RUN apt-get update && apt-get install -y \
git \
unzip \
g++ \
libzip-dev \
&& pecl -q install \
zip \
&& docker-php-ext-configure \
opcache --enable-opcache \
&& docker-php-ext-enable \
zip \
opcache

# Installing composer and prestissimo globally
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

ENV COMPOSER_ALLOW_SUPERUSER=1 COMPOSER_MEMORY_LIMIT=-1
RUN composer global require hirak/prestissimo --prefer-dist --no-progress --no-suggest --classmap-authoritative --no-plugins --no-scripts

RUN composer global require hirak/prestissimo
# Copy configuration
COPY .docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini

COPY composer.json composer.json
COPY stubs stubs
RUN composer install --no-dev --optimize-autoloader --prefer-dist

RUN mkdir /tmp/opcache

FROM php:7.4-cli as rector
WORKDIR /rector

RUN docker-php-ext-configure opcache --enable-opcache \
&& docker-php-ext-install opcache

# Copy configuration
COPY .docker/php/opcache.ini /usr/local/etc/php/conf.d/conf.d/

COPY --from=composer /app .
COPY . .

# To warmup opcache a little
RUN bin/rector list 2>&1 > /dev/null

ENTRYPOINT [ "bin/rector" ]


Expand Down