-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
147 lines (131 loc) · 3.73 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
FROM php:8.2.15-fpm-alpine3.18
ARG PHALCON_VERSION=5.6.1
ARG COMPOSER_VERSION="2.6.6"
ARG COMPOSER_SUM="72600201c73c7c4b218f1c0511b36d8537963e36aafa244757f52309f885b314"
# Install dependencies
RUN set -eux \
&& apk add --no-cache \
c-client \
ca-certificates \
freetds \
freetype \
gettext \
gmp \
icu-libs \
imagemagick \
imap \
libffi \
libgmpxx \
libintl \
libjpeg-turbo \
libpng \
libpq \
librdkafka \
libssh2 \
libstdc++ \
libtool \
libxpm \
libxslt \
libzip \
lz4-libs \
make \
rabbitmq-c \
tidyhtml \
tzdata \
unixodbc \
vips \
yaml \
zstd-libs
################################
# Install PHP extensions
################################
# Development dependencies
RUN set -eux \
&& apk add --no-cache --virtual .build-deps \
autoconf \
bzip2-dev \
cmake \
curl-dev \
freetds-dev \
freetype-dev \
g++ \
gcc \
gettext-dev \
git \
gmp-dev \
icu-dev \
imagemagick-dev \
imap-dev \
krb5-dev \
libc-dev \
libjpeg-turbo-dev \
libpng-dev \
librdkafka-dev \
libssh2-dev \
libwebp-dev \
libxml2-dev \
libxpm-dev \
libxslt-dev \
libzip-dev \
lz4-dev \
openssl-dev \
pcre-dev \
pkgconf \
postgresql-dev \
rabbitmq-c-dev \
tidyhtml-dev \
unixodbc-dev \
vips-dev \
yaml-dev \
zlib-dev \
zstd-dev \
\
# Workaround for rabbitmq linking issue
&& ln -s /usr/lib /usr/local/lib64 \
\
# Enable ffi if it exists
&& set -eux \
&& if [ -f /usr/local/etc/php/conf.d/docker-php-ext-ffi.ini ]; then \
echo "ffi.enable = 1" >> /usr/local/etc/php/conf.d/docker-php-ext-ffi.ini; \
fi \
\
# Install opcache
&& docker-php-ext-install -j$(nproc) opcache
# Install phalcon
RUN git clone --depth=1 --branch=v${PHALCON_VERSION} https://github.com/phalcon/cphalcon.git /opt/phalcon \
&& cd /opt/phalcon/build \
&& sh ./install \
&& docker-php-ext-enable phalcon
RUN docker-php-ext-install -j$(nproc) pdo_pgsql \
&& true \
&& docker-php-ext-install -j$(nproc) pgsql
#########################
# Clean up build packages
RUN docker-php-source delete \
&& apk del .build-deps \
&& rm -rf /tmp/*
RUN set -eux \
# Fix php.ini settings for enabled extensions
&& chmod +x "$(php -r 'echo ini_get("extension_dir");')"/* \
# Shrink binaries
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true)
# Install Composer
# Composer - https://getcomposer.org/download/
RUN set -eux \
&& curl -LO "https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar" \
&& echo "${COMPOSER_SUM} composer.phar" | sha256sum -c - \
&& chmod +x composer.phar \
&& mv composer.phar /usr/local/bin/composer \
&& composer --version
# Copy PHP-FPM configuration files
COPY docker/8.2-fpm/www.conf /usr/local/etc/php-fpm.d/www.conf
COPY docker/8.2-fpm/entrypoint.sh /entrypoint.sh
COPY src /application
RUN chmod u+x /entrypoint.sh
WORKDIR /application
STOPSIGNAL SIGQUIT
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 9000
CMD ["php-fpm"]