2020-01-26 16:34:32 +01:00
|
|
|
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
|
2018-12-12 09:33:46 +01:00
|
|
|
|
2020-01-26 16:34:32 +01:00
|
|
|
# Copy configuration
|
|
|
|
COPY .docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
2019-03-12 12:41:54 +01:00
|
|
|
|
2019-03-11 11:59:05 +02:00
|
|
|
COPY composer.json composer.json
|
2019-09-04 14:21:22 +02:00
|
|
|
COPY stubs stubs
|
2020-04-03 21:30:47 +02:00
|
|
|
|
|
|
|
# This is to make parsing version possible
|
|
|
|
COPY .git .git
|
|
|
|
|
2019-03-12 12:41:54 +01:00
|
|
|
RUN composer install --no-dev --optimize-autoloader --prefer-dist
|
2018-12-12 09:33:46 +01:00
|
|
|
|
2020-01-26 16:34:32 +01:00
|
|
|
RUN mkdir /tmp/opcache
|
2018-12-12 09:33:46 +01:00
|
|
|
|
2020-01-22 00:29:34 +01:00
|
|
|
COPY . .
|
2018-12-12 09:33:46 +01:00
|
|
|
|
2020-01-26 16:34:32 +01:00
|
|
|
# To warmup opcache a little
|
2020-04-20 10:34:51 +02:00
|
|
|
RUN bin/rector list
|
2020-01-26 16:34:32 +01:00
|
|
|
|
2019-03-11 11:59:05 +02:00
|
|
|
ENTRYPOINT [ "bin/rector" ]
|
2020-01-22 00:29:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
## Used for getrector.org/demo
|
|
|
|
FROM rector as rector-secured
|
|
|
|
|
|
|
|
COPY .docker/php/security.ini /usr/local/etc/php/conf.d/security.ini
|