-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphp:8.2-fpm-laravel.Dockerfile
92 lines (77 loc) · 1.8 KB
/
php:8.2-fpm-laravel.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
FROM php:8.2-fpm
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
ARG USER=user
ARG UID=1000
ARG PORT=9000
ARG WORKDIR=/app
EXPOSE $PORT
RUN apt-get update
RUN apt-get install -y \
libzip-dev \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
curl \
wget \
openssl \
libssl-dev \
libpq-dev \
libffi-dev \
git \
cmake \
autoconf \
libtool \
pkg-config \
build-essential \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install protobuf compiler (protoc)
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-linux-x86_64.zip \
&& unzip protoc-27.2-linux-x86_64.zip -d /usr/local \
&& rm protoc-27.2-linux-x86_64.zip
# Install protoc-gen-php-grpc plugin
RUN git clone --recurse-submodules -b v1.38.0 https://github.com/grpc/grpc /grpc \
&& cd /grpc \
&& mkdir -p cmake/build \
&& cd cmake/build \
&& cmake ../.. \
&& make grpc_php_plugin \
&& cp grpc_php_plugin /usr/local/bin/protoc-gen-php-grpc \
&& cd / \
&& rm -rf /grpc
# Install PHP extensions for gRPC
RUN pecl install grpc \
&& docker-php-ext-enable grpc
RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-configure ffi --with-ffi
RUN docker-php-ext-install \
pgsql \
pdo_pgsql \
zip \
pdo_mysql \
mbstring \
exif \
pcntl \
bcmath \
gd \
calendar \
ffi
RUN pecl install \
xdebug \
redis \
mongodb \
mailparse
RUN docker-php-ext-enable \
xdebug \
redis \
mongodb \
mailparse \
ffi
RUN useradd -G www-data,root -u $UID -d /home/$USER $USER
RUN mkdir -p /home/$USER/.composer && \
chown -R $USER:$USER /home/$USER
WORKDIR $WORKDIR
USER $USER
#CMD ["php-fpm"]