Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docker images to use PHP 8 #1869

Merged
merged 8 commits into from
Sep 24, 2022
2 changes: 1 addition & 1 deletion .docker/services.d/php-fpm/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/execlineb -P
php-fpm7 -F
php-fpm8 -F
37 changes: 19 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 20 additions & 20 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -12,15 +12,15 @@ 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

# Stage 3:
# - 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 \
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
36 changes: 19 additions & 17 deletions tests/docker/alpine316/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down