Skip to content

Commit 38389d8

Browse files
committed
~
1 parent 74cd4d6 commit 38389d8

File tree

5 files changed

+183
-7
lines changed

5 files changed

+183
-7
lines changed

.env.dist

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
ENABLE_FFI=false
2-
#USE_UNICODE_VERSION=14.0.0
1+
USE_FFI=true
2+
UNICODE_VERSION=latest
3+
VAR_DUMPER_SERVER=app:9912

docker-compose.dev.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ x-bash-rc: &bash-rc ./docker/.cli/.bashrc:/root/.bashrc
22

33
services:
44
app:
5-
image: dralec/php82-cli-dev
5+
build:
6+
context: ./docker
67
volumes:
78
- *bash-rc
8-
environment:
9-
USE_FFI: "${ENABLE_FFI:-0}"
10-
UNICODE_VERSION: "${USE_UNICODE_VERSION:-latest}"
11-
VAR_DUMPER_SERVER: "app:9912"

docker/Dockerfile

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Note: This Dockerfile creates a general purpose development image.
2+
FROM php:8.2-cli-alpine
3+
4+
COPY --from=composer /usr/bin/composer /usr/bin/composer
5+
6+
ARG EXT_APCU_VERSION=5.1.22
7+
ARG EXT_EVENT_VERSION=3.0.8
8+
ARG EXT_MONGODB_VERSION=1.15.1
9+
ARG EXT_REDIS_VERSION=5.3.7
10+
ARG EXT_UUID_VERSION=1.2.0
11+
ARG EXT_XDEBUG_VERSION=3.2.0
12+
13+
ARG WORKING_DIR=/app
14+
15+
ARG COMPOSER_HOME=/tmp/composer
16+
ARG PHIVE_VERSION_KEY=0x6AF725270AB81E04D79442549D8A98B29B2D5D79
17+
ARG PHPLOC_VERSION_KEY=0x4AA394086372C20A
18+
19+
ARG COMPOSER_PACKAGES="\
20+
ergebnis/composer-normalize \
21+
"
22+
23+
ARG TOOLS="\
24+
bash \
25+
coreutils\
26+
curl \
27+
git \
28+
gnupg \
29+
nano \
30+
"
31+
32+
ARG RUN_DEPS="\
33+
${TOOLS} \
34+
curl \
35+
freetype \
36+
gcompat \
37+
gmp \
38+
icu-libs \
39+
libbz2 \
40+
libevent \
41+
libffi \
42+
libintl \
43+
libjpeg-turbo \
44+
libpng \
45+
libpq \
46+
libuuid \
47+
libwebp \
48+
libxml2 \
49+
libxpm \
50+
libxslt \
51+
libzip \
52+
libzip \
53+
openssl \
54+
ttf-freefont \
55+
unzip \
56+
zlib \
57+
"
58+
59+
ARG BUILD_DEPS="\
60+
autoconf \
61+
bzip2-dev \
62+
cmake \
63+
curl-dev \
64+
file \
65+
freetype-dev \
66+
g++ \
67+
gcc \
68+
gettext-dev \
69+
git \
70+
gmp-dev \
71+
icu-dev \
72+
libc-dev \
73+
libevent-dev \
74+
libffi-dev \
75+
libjpeg-turbo-dev \
76+
libpng-dev \
77+
libpq-dev \
78+
libwebp-dev \
79+
libxml2-dev \
80+
libxpm-dev \
81+
libxslt-dev \
82+
libzip-dev \
83+
libzip-dev \
84+
linux-headers \
85+
make \
86+
openssl-dev \
87+
pcre-dev \
88+
pkgconf \
89+
re2c \
90+
util-linux-dev \
91+
zlib-dev \
92+
"
93+
94+
ARG PHP_EXTENSIONS="\
95+
bcmath \
96+
ffi \
97+
gd \
98+
gmp \
99+
intl \
100+
mysqli \
101+
opcache \
102+
pcntl \
103+
pdo_mysql \
104+
pdo_pgsql \
105+
sockets \
106+
xsl \
107+
zip \
108+
"
109+
110+
ENV COMPOSER_ALLOW_SUPERUSER 1
111+
ENV COMPOSER_HOME ${COMPOSER_HOME}
112+
113+
RUN set -eux \
114+
&& apk update \
115+
&& apk add --no-cache \
116+
${RUN_DEPS} \
117+
&& apk add --no-cache --virtual .php-build-deps \
118+
${BUILD_DEPS} \
119+
&& docker-php-ext-configure gd \
120+
--disable-gd-jis-conv \
121+
--with-freetype=/usr \
122+
--with-jpeg=/usr \
123+
--with-webp=/usr \
124+
--with-xpm=/usr \
125+
&& docker-php-ext-install -j$(nproc) ${PHP_EXTENSIONS} \
126+
&& pecl install xdebug-${EXT_XDEBUG_VERSION} \
127+
&& docker-php-ext-enable xdebug \
128+
&& pecl install -o -f \
129+
apcu-${EXT_APCU_VERSION} \
130+
mongodb-${EXT_MONGODB_VERSION} \
131+
redis-${EXT_REDIS_VERSION} \
132+
uuid-${EXT_UUID_VERSION} \
133+
&& docker-php-ext-enable \
134+
apcu \
135+
mongodb \
136+
redis \
137+
uuid \
138+
&& pecl install -o -f event-${EXT_EVENT_VERSION} \
139+
&& docker-php-ext-enable --ini-name zz-event.ini event \
140+
&& pecl clear-cache \
141+
&& rm -rfv \
142+
/tmp/* \
143+
/home/user \
144+
&& mkdir -p \
145+
/home/user \
146+
${COMPOSER_HOME} \
147+
&& chmod 777 /home/user ${COMPOSER_HOME} \
148+
&& composer global config allow-plugins.composer/package-versions-deprecated true \
149+
&& composer global config allow-plugins.phpstan/extension-installer true \
150+
&& composer global config allow-plugins.ergebnis/composer-normalize true \
151+
&& composer --no-interaction global --prefer-stable \
152+
--optimize-autoloader require \
153+
${COMPOSER_PACKAGES} \
154+
&& composer clear-cache \
155+
&& chmod -R 777 /home/user ${COMPOSER_HOME} \
156+
## // install PHIVE \
157+
&& wget -O phive.phar "https://phar.io/releases/phive.phar" \
158+
&& wget -O phive.phar.asc "https://phar.io/releases/phive.phar.asc" \
159+
&& gpg --keyserver hkps://keys.openpgp.org --recv-keys ${PHIVE_VERSION_KEY} \
160+
&& gpg --verify phive.phar.asc phive.phar \
161+
&& rm phive.phar.asc \
162+
&& chmod +x phive.phar \
163+
&& mv phive.phar /usr/local/bin/phive \
164+
## // install PHPLOC
165+
&& phive install phploc --trust-gpg-keys ${PHPLOC_VERSION_KEY} --target /usr/local/bin \
166+
&& apk del --no-cache .php-build-deps \
167+
&& rm -rf ${COMPOSER_HOME}/.htaccess ${COMPOSER_HOME}/cache \
168+
&& rm -rfv /tmp/* \
169+
## // stats
170+
&& php -m \
171+
&& php -v
172+
173+
COPY config/php/ /usr/local/etc/php/conf.d/
174+
175+
ENV PATH ${COMPOSER_HOME}/vendor/bin:${PATH}

docker/config/php/timezone.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
;Explicitly set timezone
2+
date.timezone ="UTC"

docker/config/php/xdebug.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
xdebug.mode=debug

0 commit comments

Comments
 (0)