-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (40 loc) · 1.52 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (40 loc) · 1.52 KB
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
FROM php:8.2-cli-alpine3.18
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Зависимости сборки
RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
linux-headers \
&& mkdir -p /tmp/pear/cache \
&& apk add --update --no-cache \
openssl-dev \
cmake \
libunwind \
libunwind-dev \
pcre-dev \
icu-dev \
icu-data-full \
libzip-dev \
git \
go \
# Утилита "protoc" и официальный плагин генерации клиентского кода "grpc_php_plugin"
&& mkdir /build && cd /build \
&& git clone --recursive -b v1.27.x https://github.com/grpc/grpc \
&& mkdir -p /build/grpc/cmake/build && cd /build/grpc/cmake/build \
&& cmake ../.. \
&& make protoc grpc_php_plugin \
# Плагин генерации серверного кода "protoc-gen-php-grpc" от roadrunner
&& cd /build \
&& composer create-project --ignore-platform-reqs spiral/roadrunner-cli \
&& chmod +x ./roadrunner-cli/bin/rr \
&& ./roadrunner-cli/bin/rr download-protoc-binary -l /usr/bin \
&& cp /build/grpc/cmake/build/grpc_php_plugin /usr/bin \
&& cp /build/grpc/cmake/build/third_party/protobuf/protoc /usr/bin \
&& chmod +x /usr/bin/protoc-gen-php-grpc \
&& chmod +x /usr/bin/grpc_php_plugin \
&& chmod +x /usr/bin/protoc \
# Очистка
&& rm -rf /build \
&& pecl clear-cache \
&& apk del --purge .build-deps
WORKDIR /app
CMD "protoc"