GoogleCloudPlatform / php-docker

Docker images for running PHP applications on the App Engine Flexible Runtime
Apache License 2.0
188 stars 82 forks source link

Available PHP Versions are EOL #549

Open Stoyvo opened 3 years ago

Stoyvo commented 3 years ago

PHP 7.3 is the latest supported version on App Engine, and this version of PHP was EOL January 2021. Google has offered an out-dated version of PHP, this needs to change. PHP 7.4 and PHP 8 are the actively supported versions by PHP and Google should be offering at least these versions.

What is the ETA for supported PHP versions to be used on Google App Engine?

andreladocruz commented 2 years ago

News???

Stoyvo commented 2 years ago

@donmccasland Removed PHP 7.4 and 8.0 in this commit: https://github.com/GoogleCloudPlatform/php-docker/commit/a2fe0f22949a3df0c280b77fac6aa0c83a6ff5da

I'm curious, where is the right location for this issue? It appears to be outside of this project.

andreladocruz commented 2 years ago

@Stoyvo,

I am trying to build a custom image with 7.4 and 8.0.

I can not understand why they don't support 7.4 or 8.0 versions

andreladocruz commented 2 years ago

@Stoyvo, @donmccasland

Do you know how can I create my own php7.4/8 image using this code?

I tried to build using an alpine image, but it's not working.

https://hub.docker.com/r/digitalmanagerguru/appengine-php-webserver

You can see the docker settings here:

https://bitbucket.org/digitalmanagerguru/appengine-webserver/src/dev/

This image is MUCH smaller than google's one. :P

Stoyvo commented 2 years ago

@andreladocruz I created a custom image, tried flexible environment, moved to Standard afterwards. I believe this gets most of the way.

https://gist.github.com/Stoyvo/e81ba08103fecee7d7711b4239245cef

andreladocruz commented 2 years ago

@Stoyvo ,

thanks for your help! =)

I made an image too and now it's running on our staging environment.

Looking into your files, I saw we got almost the same approach, using alpine. =)

The final image is 80% smaller and deploys 50% quicker than google's one.

I will move it into production soon. =)

andreladocruz commented 2 years ago

@Stoyvo ,

my base Dockerfile

FROM alpine:3.15.0

LABEL Maintainer="Dev Team <dev@digitalmanager.guru>" \
    Description="Base image for appengine php webserver"

RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories

RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories

RUN apk update

# Install Base Packages
RUN apk --no-cache add \
    bash \
    curl \
    nginx \
    procps \
    supervisor

# Install PHP Packages and Extensions
RUN apk --no-cache add \
    php7 \
    php7-bcmath \
    php7-ctype \
    php7-curl \
    php7-dev \
    php7-dom \
    php7-fileinfo \
    php7-fpm \
    php7-gd \
    php7-gmp \
    php7-intl \
    php7-json \
    php7-mbstring \
    php7-mysqli \
    php7-opcache \
    php7-openssl \
    php7-pcntl \
    php7-pdo \
    php7-pdo_mysql \
    php7-phar \
    php7-pear \
    php7-pecl-grpc \
    php7-pecl-protobuf \
    php7-pecl-redis \
    php7-posix \
    php7-simplexml \
    php7-soap \
    php7-tokenizer \
    php7-xml \
    php7-xmlwriter \
    php7-zip

# Create symlink so programs depending on `php` still function
RUN rm -f /usr/bin/php 
RUN ln -s /usr/bin/php7 /usr/bin/php

# Install Composer
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN rm -rf composer-setup.php

# Configure nginx
COPY config/nginx.conf /etc/nginx/nginx.conf

# Configure PHP-FPM
COPY config/fpm-pool.conf /etc/php7/php-fpm.d/www.conf
COPY config/php.ini /etc/php7/conf.d/custom.ini

# Configure supervisord
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Setup document root
RUN mkdir -p /var/www/html

# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /var/www/html && \
    chown -R nobody.nobody /run && \
    chown -R nobody.nobody /var/lib/nginx && \
    chown -R nobody.nobody /var/log/nginx

# Switch to use a non-root user from here on
USER nobody

# Add application
WORKDIR /var/www/html
COPY --chown=nobody src/ /var/www/html/

# Expose the port nginx is reachable on
EXPOSE 8080

# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping
Stoyvo commented 2 years ago

@andreladocruz you should make a gist and link to this issue, this way the community can continue to follow updates and offer suggestions

andreladocruz commented 2 years ago

@Stoyvo .. be my guest and do it with the data above.

I have no interest in this kind of bureaucracy or responsibility