forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (34 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 [ "bin/rector" ]
## Used for getrector.org/demo
FROM rector as rector-secured
COPY .docker/php/security.ini /usr/local/etc/php/conf.d/security.ini