Skip to content

Commit

Permalink
Update base image to nginx:1.27-alpine3.19, PHP to 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
awesometic committed Jul 31, 2024
1 parent 77965a1 commit 4895880
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM nginx:1.25-alpine3.17
FROM nginx:1.27-alpine3.19
LABEL maintainer="Deokgyu Yang <[email protected]>" \
description="Lightweight h5ai 0.30.0 container with Nginx 1.25 & PHP 8.1 based on Alpine Linux."
description="Lightweight h5ai 0.30.0 container with Nginx 1.27 & PHP 8.2 based on Alpine Linux."

RUN apk update
RUN apk add --no-cache \
bash bash-completion supervisor tzdata shadow \
php81 php81-fpm php81-session php81-json php81-xml php81-mbstring php81-exif \
php81-intl php81-gd php81-pecl-imagick php81-zip php81-opcache \
php82 php82-fpm php82-session php82-json php82-xml php82-mbstring php82-exif \
php82-intl php82-gd php82-pecl-imagick php82-zip php82-opcache \
ffmpeg imagemagick zip apache2-utils patch

# Environments
Expand All @@ -19,9 +19,9 @@ ENV HTPASSWD_PW=''

# Copy configuration files
COPY config/h5ai.conf /etc/nginx/conf.d/h5ai.conf
COPY config/php_set_timezone.ini /etc/php81/conf.d/00_timezone.ini
COPY config/php_set_jit.ini /etc/php81/conf.d/00_jit.ini
COPY config/php_set_memory_limit.ini /etc/php81/conf.d/00_memlimit.ini
COPY config/php_set_timezone.ini /etc/php82/conf.d/00_timezone.ini
COPY config/php_set_jit.ini /etc/php82/conf.d/00_jit.ini
COPY config/php_set_memory_limit.ini /etc/php82/conf.d/00_memlimit.ini
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Copy h5ai
Expand Down
8 changes: 4 additions & 4 deletions config/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ echo -e "Variables:
\\t- HTPASSWD_USER=${HTPASSWD_USER}
\\t- HTPASSWD_PW=${HTPASSWD_PW}"

if [ "$( grep -rni "$TZ" /etc/php81/conf.d/00_timezone.ini | wc -l )" -eq 0 ]; then
if [ "$( grep -rni "$TZ" /etc/php82/conf.d/00_timezone.ini | wc -l )" -eq 0 ]; then
msg "Configure timezone for PHP..."
echo "$TZ\"" >> /etc/php81/conf.d/00_timezone.ini
echo "$TZ\"" >> /etc/php82/conf.d/00_timezone.ini
fi

msg "Make config directories..."
Expand Down Expand Up @@ -106,8 +106,8 @@ fi

msg "Fix ownership for Nginx and php-fpm..."
sed -i "s#user nginx;.*#user abc;#g" /etc/nginx/nginx.conf
sed -i "s#user = nobody.*#user = abc#g" /etc/php81/php-fpm.d/www.conf
sed -i "s#group = nobody.*#group = abc#g" /etc/php81/php-fpm.d/www.conf
sed -i "s#user = nobody.*#user = abc#g" /etc/php82/php-fpm.d/www.conf
sed -i "s#group = nobody.*#group = abc#g" /etc/php82/php-fpm.d/www.conf

msg "Set ownership to the configuration files..."
chown -R abc:abc /config
Expand Down
2 changes: 1 addition & 1 deletion config/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ nodaemon=true
user=root

[program:php-fpm]
command=php-fpm81 -F
command=php-fpm82 -F
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
Expand Down

0 comments on commit 4895880

Please sign in to comment.