mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-16 05:44:59 +01:00
* Changed docker working directory to project and running rector from path * Fixed path of Docker entrypoint for rector * Improve Docker docs in readme * [rector] Improve Docker docs in readme * [cs] Improve Docker docs in readme Co-authored-by: rector-bot <tomas@getrector.org>
53 lines
1.2 KiB
Docker
53 lines
1.2 KiB
Docker
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
|
|
|
|
# Copy configuration
|
|
COPY .docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
|
|
|
COPY composer.json composer.json
|
|
COPY stubs stubs
|
|
|
|
# This is to make parsing version possible
|
|
COPY .git .git
|
|
|
|
RUN composer install --no-dev --optimize-autoloader --prefer-dist
|
|
|
|
RUN mkdir /tmp/opcache
|
|
|
|
COPY . .
|
|
|
|
# To warmup opcache a little
|
|
RUN bin/rector list
|
|
|
|
ENTRYPOINT [ "rector" ]
|
|
|
|
ENV PATH /rector/bin:$PATH
|
|
|
|
VOLUME ["/project"]
|
|
WORKDIR "/project"
|
|
|
|
## Used for getrector.org/demo
|
|
FROM rector as rector-secured
|
|
|
|
COPY .docker/php/security.ini /usr/local/etc/php/conf.d/security.ini
|