Skip to content

Commit 0226c9f

Browse files
committed
[5.0.x] - fix(docker): restore dockerfiles for local development.
1 parent 2416fc5 commit 0226c9f

File tree

12 files changed

+788
-0
lines changed

12 files changed

+788
-0
lines changed

docker/8.1/.bashrc

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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 '

docker/8.1/Dockerfile

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
FROM composer:latest as composer
2+
FROM php:8.1-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.1" \
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+
# PECL Packages
44+
RUN pecl install -o -f redis && \
45+
pecl install igbinary \
46+
msgpack \
47+
apcu \
48+
yaml \
49+
imagick \
50+
memcached \
51+
xdebug \
52+
zephir_parser
53+
54+
# Locale
55+
RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
56+
sed -i -e 's/# el_GR.UTF-8 UTF-8/el_GR.UTF-8 UTF-8/' /etc/locale.gen && \
57+
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
58+
sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \
59+
sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
60+
dpkg-reconfigure --frontend=noninteractive locales && \
61+
update-locale LANG=en_US.UTF-8
62+
63+
# Install PHP extensions
64+
RUN docker-php-ext-configure gd --with-freetype \
65+
--with-jpeg=/usr/include/ \
66+
--with-xpm \
67+
--with-webp \
68+
--enable-gd
69+
70+
RUN docker-php-ext-install \
71+
gd \
72+
gettext \
73+
gmp \
74+
intl \
75+
pdo_mysql \
76+
pdo_pgsql \
77+
zip
78+
79+
# Install PHP extensions
80+
RUN docker-php-ext-enable \
81+
redis \
82+
igbinary \
83+
msgpack \
84+
apcu \
85+
imagick \
86+
yaml \
87+
memcached \
88+
xdebug \
89+
zephir_parser
90+
91+
# Composer
92+
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
93+
# Bash script with helper aliases
94+
COPY ./.bashrc /root/.bashrc
95+
COPY ./.bashrc /home/phalcon/.bashrc
96+
97+
CMD ["php-fpm"]

docker/8.1/extra.ini

Lines changed: 8 additions & 0 deletions
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"

docker/8.2/.bashrc

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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 '

docker/8.2/Dockerfile

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
FROM composer:latest as composer
2+
FROM php:8.2-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.2" \
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+
# PECL Packages
44+
RUN pecl install -o -f redis && \
45+
pecl install igbinary \
46+
msgpack \
47+
apcu \
48+
yaml \
49+
imagick \
50+
memcached \
51+
xdebug \
52+
zephir_parser
53+
54+
# Locale
55+
RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
56+
sed -i -e 's/# el_GR.UTF-8 UTF-8/el_GR.UTF-8 UTF-8/' /etc/locale.gen && \
57+
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
58+
sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \
59+
sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
60+
dpkg-reconfigure --frontend=noninteractive locales && \
61+
update-locale LANG=en_US.UTF-8
62+
63+
# Install PHP extensions
64+
RUN docker-php-ext-configure gd --with-freetype \
65+
--with-jpeg=/usr/include/ \
66+
--with-xpm \
67+
--with-webp \
68+
--enable-gd
69+
70+
RUN docker-php-ext-install \
71+
gd \
72+
gettext \
73+
gmp \
74+
intl \
75+
pdo_mysql \
76+
pdo_pgsql \
77+
zip
78+
79+
# Install PHP extensions
80+
RUN docker-php-ext-enable \
81+
redis \
82+
igbinary \
83+
msgpack \
84+
apcu \
85+
imagick \
86+
yaml \
87+
memcached \
88+
xdebug \
89+
zephir_parser
90+
91+
# Composer
92+
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
93+
# Bash script with helper aliases
94+
COPY ./.bashrc /root/.bashrc
95+
COPY ./.bashrc /home/phalcon/.bashrc
96+
97+
CMD ["php-fpm"]

docker/8.2/extra.ini

Lines changed: 8 additions & 0 deletions
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)