Coder Social home page Coder Social logo

joseluisq / alpine-php-fpm Goto Github PK

View Code? Open in Web Editor NEW
180.0 180.0 44.0 309 KB

Lightweight & optimized Multi-Arch Docker Images (x86_64/arm/arm64) for PHP-FPM (PHP 8.1, 8.2, 8.3) with essential extensions on top of latest Alpine Linux. :elephant:

License: Apache License 2.0

Dockerfile 78.85% Makefile 3.43% Shell 17.72%
alpine alpine-linux arm arm64 armv6 armv7 composer docker docker-image php php-extensions php-fpm php7 php8 x86 x86-64

alpine-php-fpm's People

Contributors

joseluisq avatar ssheduardo avatar tiagodevweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

alpine-php-fpm's Issues

8.1 build fail

#7 19.43 (7/7) Installing .phpize-deps-configure (20220414.070318)
397#7 19.43 Executing busybox-1.34.1-r5.trigger
398#7 19.44 OK: 916 MiB in 281 packages
399#7 19.52 Configuring for:
400#7 19.52 PHP Api Version: 20210902
401#7 19.52 Zend Module Api No: 20210902
402#7 19.52 Zend Extension Api No: 420210902
403#7 19.95 configure.ac:18: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
404#7 19.95 build/php.m4:2111: PHP_CONFIG_NICE is expanded from...
405#7 19.95 configure.ac:18: the top level
406#7 19.95 configure.ac:161: warning: The macro AC_LANG_C' is obsolete. 407#7 19.95 configure.ac:161: You should run autoupdate. 408#7 19.95 ./lib/autoconf/c.m4:72: AC_LANG_C is expanded from... 409#7 19.95 build/libtool.m4:2739: _LT_AC_LANG_C_CONFIG is expanded from... 410#7 19.95 build/libtool.m4:2738: AC_LIBTOOL_LANG_C_CONFIG is expanded from... 411#7 19.95 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... 412#7 19.95 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... 413#7 19.95 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... 414#7 19.95 configure.ac:161: the top level 415#7 19.95 configure.ac:161: warning: The macro AC_LANG_C' is obsolete.
416#7 19.95 configure.ac:161: You should run autoupdate.
417#7 19.95 ./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
418#7 19.95 lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
419#7 19.95 lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
420#7 19.95 ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
421#7 19.95 ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
422#7 19.95 build/libtool.m4:561: _LT_AC_LOCK is expanded from...
423#7 19.95 build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
424#7 19.95 build/libtool.m4:2739: _LT_AC_LANG_C_CONFIG is expanded from...
425#7 19.95 build/libtool.m4:2738: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
426#7 19.95 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
427#7 19.95 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
428#7 19.95 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
429#7 19.95 configure.ac:161: the top level

How to install xdebug in the joseluisq/php-fpm:8.2

I am using joseluisq/php-fpm:8.2 and want to install on top of it xdebug for my local environment

My old development dockerfile fails because can't find xdebug pcl

FROM joseluisq/php-fpm:8.2 as base

FROM base as local

ARG DOMAIN
ARG NAME

USER root
RUN mkdir -p /etc/nginx/sites-enabled && ln -s /etc/nginx/sites-available/site /etc/nginx/sites-enabled/

# xdebug
RUN apk add php8-pecl-xdebug
# Xdebug config
COPY ./$NAME/xdebug_config.ini /etc/php8/conf.d/50_xdebug.ini

# utils
RUN apk add openssh \
    && apk add nano \
    && apk add git

#Enable ssh login
RUN apk add openrc && rc-update add sshd \
    && sed -i '/^#Port 22/s/^#//' /etc/ssh/sshd_config \
    && sed -i '/^#PasswordAuthentication/s/^#//' /etc/ssh/sshd_config \
    && sed -i '/^#PermitEmptyPasswords no/s/^#PermitEmptyPasswords no/PermitEmptyPasswords yes/' /etc/ssh/sshd_config \
    && sed -i '/^#PermitRootLogin prohibit-password/s/^#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
    && echo "root:Test" | chpasswd

# Permissions only for developingto allow docker-compose mount code
RUN echo -e 'user = 1000\ngroup = 1000' >> /etc/php8/php-fpm.d/www.conf
RUN chown -R root.root /var/www/html && \
  chown -R root.root /run && \
  chown -R root.root /var/lib/nginx && \
  chown -R root.root /var/log/nginx

COPY ./$NAME/nginx.conf /etc/nginx/nginx.conf

WORKDIR /var/www/html/app

COPY ./$NAME/entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]

The error I get is

 > [local  2/10] RUN apk add php8-pecl-xdebug:
#6 0.205 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/aarch64/APKINDEX.tar.gz
#6 0.990 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/aarch64/APKINDEX.tar.gz
#6 1.751 ERROR: unable to select packages:
#6 1.768   php8-pecl-xdebug (no such package):
#6 1.768     required by: world[php8-pecl-xdebug]

How to add odbc for sqlsrv?

How to add odbc for sqlsrv?

I recive error This extension requires the Microsoft ODBC Driver for SQL Server - php 8.2

Docker ARM64 Image

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
We would like to be able to use php-fpm on ARM 64 Docker environments.

Describe alternatives you've considered
Probably we want to revisit https://www.docker.com/blog/multi-arch-images/

Additional context
No

PSR conflict with Symfony

Hi, I ran into an issue today that the PSR extension conflicts with the Symfony cache component. I therefore had to remove PSR, but as there is no "docker-php-ext-disable" (and it will not be there, see docker-library/php#220 (comment)) I tried "pecl uninstall psr". Unfortunately that created another issue:

PHP Warning:  PHP Startup: Unable to load dynamic library 'psr' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/psr (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20230831/psr: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20230831/psr.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20230831/psr.so: No such file or directory)) in Unknown on line 0

I could of course create a PR for the removal of PSR, but it might be more interesting to have a ENV variable control the installation of PSR (and maybe other extensions).

How do you feel about this?

Correr php con el server local.

Vi tú ejemplo de como correr con el servidor local en una solo línea pero me decidí a pasarlo a un docker-compose.yml y hacer pruebas (si vi que tienes una opción de usarlo con nginx) pero como quiero hacer algo simple, bueno al lío.
Tengo este docker-compose.yml

version: '3.3'
services:
    php-fpm:
        ports:
            - '8088:80'
        image: 'joseluisq/php-fpm:8.0'
        container_name: php-fpm
        working_dir: /var/www/html
        restart: unless-stopped
        volumes:
            - .:/var/www/html

Veo en los logs que esta bien, pero al ejecutar para lanzar el server local y acceder por el puerto 8088 me da error

Pero al ejecutar

dce php-fpm php -S 8088:80 -t

image

image

Qué estoy haciendo mal?

Nginx + PHP via single Dockerfile?

Haven't been able to make use of your version of Nginx + PHP via FPM-PHP because my deployment requires a dockerfile, not a docker-compose.

I've been tinkering with how to get the Nginx + PHP working inside a single dockerfile, but having no real luck. I'm usually pretty good at this stuff but not today.

Using the example from docker-compose and fairly common Docker syntax, this is what I have so far.

FROM nginx:1.17-alpine

COPY conf.d/ /etc/nginx/conf.d/
COPY nginx.conf /etc/nginx/nginx.conf

FROM joseluisq/php-fpm

USER root
COPY backend/ /var/www/html
RUN chown -R nobody.nobody /var/www/html

ENV ENV_SUBSTITUTION_ENABLE=true
ENV PHP_MEMORY_LIMIT=512M
ENV PHP_FPM_LISTEN=9090
ENV PHP_SESSION_GC_MAXLIFETIME=7200
ENV NODE_ENV production

USER nobody

EXPOSE 80
CMD ["php-fpm"]

When building, then running I get the following error:

/envsubst.sh: line 14: can't create /usr/local/etc/php-fpm.conf: Permission denied

If I remove "USER nobody", then I can clear this permission denied problem, but now get an Empty Response error from the webserver. I believe the port is 80 for Nginx.

I'm now trying to get "FROM joseluisq/php-fpm:8.1" working instead... but still getting empty responses. Perhaps my /var/www/html is bad location.

Do you know of a better way to accomplish what I am trying to do here?

Change www-data user/group id's?

Hi, how do I change www-data id's to match my host user?

This needs to happen automatically when I create container from image based on environment variable. I know I can docker exec sh manually and change id's from there. But my problem is that I need to support automatic deployments as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.