Merge pull request #1869 from shaarli/docker-alpine-php8

update docker images to use PHP 8
This commit is contained in:
nodiscc 2022-09-24 15:58:23 +00:00 committed by GitHub
commit dc589b7490
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 60 additions and 57 deletions

View file

@ -1,2 +1,2 @@
#!/bin/execlineb -P
php-fpm7 -F
php-fpm8 -F

View file

@ -32,29 +32,30 @@ LABEL maintainer="Shaarli Community"
RUN apk --update --no-cache add \
ca-certificates \
nginx \
php7 \
php7-ctype \
php7-curl \
php7-fpm \
php7-gd \
php7-iconv \
php7-intl \
php7-json \
php7-mbstring \
php7-openssl \
php7-session \
php7-xml \
php7-simplexml \
php7-zlib \
php8 \
php8-ctype \
php8-curl \
php8-fpm \
php8-gd \
php8-gettext \
php8-iconv \
php8-intl \
php8-json \
php8-mbstring \
php8-openssl \
php8-session \
php8-xml \
php8-simplexml \
php8-zlib \
s6
COPY .docker/nginx.conf /etc/nginx/nginx.conf
COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
COPY .docker/php-fpm.conf /etc/php8/php-fpm.conf
COPY .docker/services.d /etc/services.d
RUN rm -rf /etc/php7/php-fpm.d/www.conf \
&& sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
&& sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
RUN rm -rf /etc/php8/php-fpm.d/www.conf \
&& sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php8/php.ini \
&& sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php8/php.ini
WORKDIR /var/www

View file

@ -3,7 +3,7 @@
# - Build documentation
FROM arm32v6/alpine:3.16 as docs
ADD . /usr/src/app/shaarli
RUN apk --update --no-cache add py2-pip \
RUN apk --update --no-cache add py3-pip \
&& cd /usr/src/app/shaarli \
&& pip install --no-cache-dir mkdocs \
&& mkdocs build --clean
@ -12,7 +12,7 @@ RUN apk --update --no-cache add py2-pip \
# - Resolve PHP dependencies with Composer
FROM arm32v6/alpine:3.16 as composer
COPY --from=docs /usr/src/app/shaarli /app/shaarli
RUN apk --update --no-cache add php7-curl php7-mbstring php7-simplexml composer \
RUN apk --update --no-cache add php8-curl php8-mbstring php8-simplexml composer \
&& cd /app/shaarli \
&& composer --prefer-dist --no-dev install
@ -20,7 +20,7 @@ RUN apk --update --no-cache add php7-curl php7-mbstring php7-simplexml composer
# - Frontend dependencies
FROM arm32v6/alpine:3.16 as node
COPY --from=composer /app/shaarli /shaarli
RUN apk --update --no-cache add yarn nodejs-current python2 build-base \
RUN apk --update --no-cache add yarn nodejs-current python3 build-base \
&& cd /shaarli \
&& yarnpkg install \
&& yarnpkg run build \
@ -34,28 +34,28 @@ LABEL maintainer="Shaarli Community"
RUN apk --update --no-cache add \
ca-certificates \
nginx \
php7 \
php7-ctype \
php7-curl \
php7-fpm \
php7-gd \
php7-iconv \
php7-intl \
php7-json \
php7-mbstring \
php7-openssl \
php7-session \
php7-xml \
php7-zlib \
php8 \
php8-ctype \
php8-curl \
php8-fpm \
php8-gd \
php8-iconv \
php8-intl \
php8-json \
php8-mbstring \
php8-openssl \
php8-session \
php8-xml \
php8-zlib \
s6
COPY .docker/nginx.conf /etc/nginx/nginx.conf
COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
COPY .docker/php-fpm.conf /etc/php8/php-fpm.conf
COPY .docker/services.d /etc/services.d
RUN rm -rf /etc/php7/php-fpm.d/www.conf \
&& sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
&& sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
RUN rm -rf /etc/php8/php-fpm.d/www.conf \
&& sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php8/php.ini \
&& sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php8/php.ini
WORKDIR /var/www

View file

@ -165,7 +165,7 @@ htmldoc:
### Generate Shaarli's translation compiled file (.mo)
translate:
@find inc/languages/ -name shaarli.po -execdir msgfmt shaarli.po -o shaarli.mo \;
@for pofile in $(find inc/languages/ -name shaarli.po); do msgfmt "$pofile" -o "$(dirname "$pofile")/$(basename "$pofile" .po).mo"; done
### Run ESLint check against Shaarli's JS files
eslint:

View file

@ -5,23 +5,25 @@ RUN apk --update --no-cache add \
ca-certificates \
curl \
make \
php7 \
php7-ctype \
php7-curl \
php7-dom \
php7-gd \
php7-iconv \
php7-intl \
php7-json \
php7-mbstring \
php7-openssl \
php7-phar \
php7-session \
php7-simplexml \
php7-tokenizer \
php7-xdebug \
php7-xml \
php7-zlib \
php8 \
php8-ctype \
php8-curl \
php8-dom \
php8-gd \
php8-gettext \
php8-iconv \
php8-intl \
php8-json \
php8-mbstring \
php8-openssl \
php8-phar \
php8-session \
php8-simplexml \
php8-tokenizer \
php8-xdebug \
php8-xmlwriter \
php8-xml \
php8-zlib \
rsync
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer