forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (44 loc) · 1.12 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
49
50
51
52
53
54
55
56
57
58
ARG PHP_VERSION=8.0
FROM php:${PHP_VERSION}-cli as base
RUN apt-get update && apt-get install -y \
libzip4 \
libicu63 \
&& rm -rf /var/lib/apt/lists/*
FROM base as build
WORKDIR /rector
# Install php extensions
RUN apt-get update && apt-get install -y \
g++ \
git \
libicu-dev \
libzip-dev \
unzip \
wget \
zip \
&& pecl -q install \
zip \
&& docker-php-ext-configure intl \
&& docker-php-ext-configure opcache --enable-opcache \
&& docker-php-ext-install \
intl \
opcache \
zip
# Add source
COPY . .
# Build runtime image
FROM base as rector
COPY --from=build /usr/local/lib/php /usr/local/lib/php
COPY --from=build /usr/local/etc/php /usr/local/etc/php
COPY .docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
ENV PATH /rector/bin:$PATH
# Add source
COPY . /rector
ENTRYPOINT [ "rector" ]
VOLUME ["/project"]
WORKDIR "/project"
RUN mkdir -p /tmp/opcache
RUN chmod +x /rector/bin/rector
RUN /rector/bin/rector list
RUN mkdir -p /tmp/opcache \
&& /rector/bin/rector list \
&& chmod 777 -R /tmp