Skip to content

Commit d623b34

Browse files
author
Felipe Almeida Baccaro
committed
removing "CMD ["composer", "self-update", "clear-cache"]" line from php-cli images and adding 8.4-amazonlinux
1 parent 5ee6be8 commit d623b34

9 files changed

Lines changed: 134 additions & 6 deletions

File tree

8.3-alpine/cli/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ COPY composer-installater.sh /composer-installation.sh
4646

4747
RUN chmod +x /composer-installation.sh && /composer-installation.sh && rm /composer-installation.sh
4848

49-
CMD ["composer", "self-update", "clear-cache"]
50-
5149
FROM base AS prod
5250

5351
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

8.4-alpine/cli/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ COPY composer-installater.sh /composer-installation.sh
4646

4747
RUN chmod +x /composer-installation.sh && /composer-installation.sh && rm /composer-installation.sh
4848

49-
CMD ["composer", "self-update", "clear-cache"]
50-
5149
FROM base AS prod
5250

5351
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

8.4-amazonlinux/cli/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM amazonlinux:2023 AS base
2+
3+
RUN dnf update -y \
4+
&& dnf install -y php-devel php-pear gcc make php8.4 php8.4-cli php8.4-mbstring php8.4-intl php8.4-pdo php8.4-zip php8.4-sodium php8.4-opcache php8.4-mysqlnd php8.4-soap \
5+
&& pecl install redis \
6+
&& dnf remove -y php-devel php-pear gcc make \
7+
&& dnf clean all
8+
9+
RUN adduser -u 1090 www-data \
10+
&& mkdir -p /var/www/html \
11+
&& chown www-data:www-data /var/www/html \
12+
&& chmod 1777 /var/www/html
13+
14+
WORKDIR /var/www/html
15+
16+
CMD ["php", "-a"]
17+
18+
FROM base AS dev
19+
20+
RUN dnf update -y \
21+
&& dnf install -y php-devel php-pear autoconf automake libtool make \
22+
&& pecl install xdebug \
23+
&& dnf remove -y php-devel php-pear autoconf automake libtool make \
24+
&& dnf clean all
25+
26+
COPY etc/php-ext-xdebug.ini /etc/php.d/xdebug.ini
27+
28+
COPY composer-installater.sh /composer-installation.sh
29+
30+
RUN chmod +x /composer-installation.sh && /composer-installation.sh && rm /composer-installation.sh
31+
32+
FROM base AS prod
33+
34+
USER www-data
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
4+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
5+
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
6+
7+
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
8+
then
9+
>&2 echo 'ERROR: Invalid installer checksum'
10+
rm composer-setup.php
11+
exit 1
12+
fi
13+
14+
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
15+
RESULT=$?
16+
rm composer-setup.php
17+
exit $RESULT
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
xdebug.mode=develop,coverage,debug,profile
2+
xdebug.client_host=host.docker.internal
3+
xdebug.log=/dev/stdout
4+
xdebug.start_with_request=yes
5+
xdebug.client_port=9003
6+
xdebug.log_level=0

8.4-amazonlinux/fpm/Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM amazonlinux:2023 AS base
2+
3+
RUN dnf update -y \
4+
&& dnf install -y php-devel php-pear gcc make php8.4 php8.4-fpm php8.4-mbstring php8.4-intl php8.4-pdo php8.4-zip php8.4-sodium php8.4-opcache php8.4-mysqlnd php8.4-soap \
5+
&& pecl install redis \
6+
&& dnf remove -y php-devel php-pear gcc make \
7+
&& dnf clean all
8+
9+
RUN adduser -u 1090 www-data \
10+
&& mkdir -p /var/www/html \
11+
&& chown www-data:www-data /var/www/html \
12+
&& chmod 1777 /var/www/html \
13+
&& mkdir -p /run/php-fpm/
14+
15+
COPY etc/zz-php-fpm-docker.conf /etc/php-fpm.d/zz-php-fpm-docker.conf
16+
17+
RUN echo '[global]' >> /etc/php-fpm.conf \
18+
&& echo 'include=/etc/php-fpm.d/*.conf' >> /etc/php-fpm.conf
19+
20+
STOPSIGNAL SIGQUIT
21+
22+
EXPOSE 9000
23+
24+
WORKDIR /var/www/html
25+
26+
CMD ["php-fpm", "-F"]
27+
28+
FROM base AS dev
29+
30+
RUN dnf update -y \
31+
&& dnf install -y php-devel php-pear autoconf automake libtool make \
32+
&& pecl install xdebug \
33+
&& dnf remove -y php-devel php-pear autoconf automake libtool make \
34+
&& dnf clean all
35+
36+
COPY etc/php-ext-xdebug.ini /etc/php.d/xdebug.ini
37+
38+
FROM base AS prod
39+
USER www-data
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
xdebug.mode=develop,coverage,debug,profile
2+
xdebug.client_host=host.docker.internal
3+
xdebug.log=/dev/stdout
4+
xdebug.start_with_request=yes
5+
xdebug.client_port=9003
6+
xdebug.log_level=0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[global]
2+
error_log = /proc/self/fd/2
3+
daemonize = no
4+
log_limit = 8192
5+
[www]
6+
access.log = /proc/self/fd/2
7+
clear_env = no
8+
catch_workers_output = yes
9+
decorate_workers_output = no
10+
listen = 9000
11+
user = www-data
12+
group = www-data

versions.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"path": "8.3-alpine/cli",
66
"tag": "2026.1.1",
77
"stages": ["dev"],
8-
"build": false,
9-
"push": false
8+
"build": true,
9+
"push": true
1010
},
1111
{
1212
"namespace": "wiredupdev",
@@ -34,5 +34,23 @@
3434
"stages": ["dev", "prod"],
3535
"build": true,
3636
"push": true
37+
},
38+
{
39+
"namespace": "wiredupdev",
40+
"repository": "php-fpm-8.4-amazonlinux",
41+
"path": "8.4-amazonlinux/fpm",
42+
"tag": "2026.1.1",
43+
"stages": ["dev", "prod"],
44+
"build": true,
45+
"push": true
46+
},
47+
{
48+
"namespace": "wiredupdev",
49+
"repository": "php-cli-8.4-amazonlinux",
50+
"path": "8.4-amazonlinux/cli",
51+
"tag": "2026.1.1",
52+
"stages": ["dev", "prod"],
53+
"build": true,
54+
"push": true
3755
}
3856
]

0 commit comments

Comments
 (0)