Skip to content

Commit 53564da

Browse files
committed
#16671 - Add PHP8.4 into docker files
1 parent 190c697 commit 53564da

File tree

4 files changed

+214
-0
lines changed

4 files changed

+214
-0
lines changed

Diff for: docker-compose.yml

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ services:
3535
volumes:
3636
- .:/srv
3737

38+
cphalcon-8.4:
39+
container_name: cphalcon-8.4
40+
hostname: cphalcon-84
41+
build: docker/8.4
42+
working_dir: /srv
43+
volumes:
44+
- .:/srv
45+
3846
mysql:
3947
container_name: cphalcon-mysql
4048
image: mysql:5.7

Diff for: docker/8.4/.bashrc

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/bin/bash
2+
3+
# Easier navigation: .., ..., ...., ....., ~ and -
4+
alias ..="cd .."
5+
alias ...="cd ../.."
6+
alias ....="cd ../../.."
7+
alias .....="cd ../../../.."
8+
alias ~="cd ~" # `cd` is probably faster to type though
9+
alias -- -="cd -"
10+
11+
# Shortcuts
12+
alias g="git"
13+
alias h="history"
14+
15+
# Detect which `ls` flavor is in use
16+
if ls --color > /dev/null 2>&1; then # GNU `ls`
17+
colorflag="--color"
18+
else # OS X `ls`
19+
colorflag="-G"
20+
fi
21+
22+
# List all files colorized in long format
23+
# shellcheck disable=SC2139
24+
alias l="ls -lF ${colorflag}"
25+
26+
# List all files colorized in long format, including dot files
27+
# shellcheck disable=SC2139
28+
alias la="ls -laF ${colorflag}"
29+
30+
# List only directories
31+
# shellcheck disable=SC2139
32+
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
33+
34+
# See: https://superuser.com/a/656746/280737
35+
alias ll='LC_ALL="C.UTF-8" ls -alF'
36+
37+
# Always use color output for `ls`
38+
# shellcheck disable=SC2139
39+
alias ls="command ls ${colorflag}"
40+
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
41+
42+
# Always enable colored `grep` output
43+
alias grep='grep --color=auto '
44+
45+
# Enable aliases to be sudo’ed
46+
alias sudo='sudo '
47+
48+
# Get week number
49+
alias week='date +%V'
50+
51+
# Stopwatch
52+
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
53+
54+
# Canonical hex dump; some systems have this symlinked
55+
command -v hd > /dev/null || alias hd="hexdump -C"
56+
57+
# vhosts
58+
alias hosts='sudo nano /etc/hosts'
59+
60+
# copy working directory
61+
alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard'
62+
63+
# copy file interactive
64+
alias cp='cp -i'
65+
66+
# move file interactive
67+
alias mv='mv -i'
68+
69+
# untar
70+
alias untar='tar xvf'
71+
72+
# Zephir related
73+
alias untar='tar xvf'
74+
75+
NB_CORES=$(grep -c '^processor' /proc/cpuinfo)
76+
export MAKEFLAGS="-j$((NB_CORES)) -l${NB_CORES}"
77+
78+
alias zephir='./vendor/bin/zephir '
79+
alias zf='./vendor/bin/zephir fullclean'
80+
alias zg='./vendor/bin/zephir generate'
81+
alias zs='./vendor/bin/zephir stubs'
82+
alias cpl='zf && zg && cd ext/ && ./install && ..'
83+
alias codecept='php -d extension=ext/modules/phalcon.so ./vendor/bin/codecept '
84+
alias phpcs='php -d extension=ext/modules/phalcon.so ./vendor/bin/phpcs '
85+
alias phpcbf='php -d extension=ext/modules/phalcon.so ./vendor/bin/phpcbf '
86+
alias psalm='php ./vendor/bin/psalm '
87+
88+
alias test-unit='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter unit'
89+
alias test-cli='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter cli'
90+
alias test-integration='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter integration'
91+
alias test-db-common='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database -g common'
92+
alias test-db-mysql='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env mysql -g mysql'
93+
alias test-db-pgsql='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env pgsql -g pgsql'
94+
alias test-db-sqlite='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env sqlite -g sqlite'
95+
alias test-db='test-db-common && test-db-mysql && test-db-pgsql && test-db-sqlite'
96+
alias test-all='test-unit && test-cli && test-integration && test-db'

Diff for: docker/8.4/Dockerfile

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
FROM composer:latest as composer
2+
FROM php:8.4-fpm
3+
4+
ADD ./extra.ini /usr/local/etc/php/conf.d/
5+
6+
# User/Group globals
7+
ENV MY_USER="phalcon" \
8+
MY_GROUP="phalcon" \
9+
MY_UID="1000" \
10+
MY_GID="1000" \
11+
PHP_VERSION="8.3" \
12+
LANG=en_US.UTF-8 \
13+
LANGUAGE=en_US.UTF-8 \
14+
LC_ALL=en_US.UTF-8
15+
16+
# User and Group
17+
RUN set -eux && \
18+
groupadd -g ${MY_GID} -r ${MY_GROUP} && \
19+
useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
20+
21+
# Update
22+
RUN apt update -y && \
23+
apt install -y \
24+
apt-utils \
25+
gettext \
26+
git \
27+
libgmp-dev \
28+
libicu-dev \
29+
libmagickwand-dev \
30+
libmemcached-dev \
31+
libpng-dev \
32+
libpq-dev \
33+
libyaml-dev \
34+
libwebp-dev \
35+
libxpm-dev \
36+
libzip-dev \
37+
locales \
38+
nano \
39+
sudo \
40+
wget \
41+
zip
42+
43+
# Remove this RUN when imagick will be available via pecl
44+
RUN cd /opt && \
45+
git clone https://github.com/Imagick/imagick.git && \
46+
cd imagick && \
47+
phpize && ./configure && \
48+
make && make install
49+
50+
# PECL Packages
51+
RUN pecl install -o -f redis && \
52+
pecl install igbinary \
53+
msgpack \
54+
apcu \
55+
yaml \
56+
# imagick \
57+
memcached \
58+
zephir_parser
59+
60+
# Locale
61+
RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
62+
sed -i -e 's/# el_GR.UTF-8 UTF-8/el_GR.UTF-8 UTF-8/' /etc/locale.gen && \
63+
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
64+
sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \
65+
sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
66+
dpkg-reconfigure --frontend=noninteractive locales && \
67+
update-locale LANG=en_US.UTF-8
68+
69+
# Install PHP extensions
70+
RUN docker-php-ext-configure gd --with-freetype \
71+
--with-jpeg=/usr/include/ \
72+
--with-xpm \
73+
--with-webp \
74+
--enable-gd
75+
76+
RUN docker-php-ext-install \
77+
gd \
78+
gettext \
79+
gmp \
80+
intl \
81+
pdo_mysql \
82+
pdo_pgsql \
83+
zip
84+
85+
# Install PHP extensions
86+
RUN docker-php-ext-enable \
87+
redis \
88+
igbinary \
89+
msgpack \
90+
apcu \
91+
imagick \
92+
yaml \
93+
memcached \
94+
zephir_parser
95+
96+
# Composer
97+
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
98+
# Bash script with helper aliases
99+
COPY ./.bashrc /root/.bashrc
100+
COPY ./.bashrc /home/phalcon/.bashrc
101+
102+
CMD ["php-fpm"]

Diff for: docker/8.4/extra.ini

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error_reporting=E_ALL
2+
display_errors="On"
3+
display_startup_errors="On"
4+
log_errors="On"
5+
error_log=/tmp/php_errors.log
6+
memory_limit=512M
7+
apc.enable_cli="On"
8+
session.save_path="/tmp"

0 commit comments

Comments
 (0)