How to run PHP for Nginx with PHP-FPM using Docker and docker-compose

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 4

  • @jordan_777.
    @jordan_777. Месяц назад

    Is there a way to do this without the volumes? I've been researching for days and people on stack overflow are telling me it's possible when you update the fastcgi file to direct to the php-fpm container properly.
    Without the volume in each container I get 404 and 502 errors. Surely there's a way to do this without the volumes to keep those truly containerised?
    My setup is basically just like yours.

    • @andrewwwlife
      @andrewwwlife  Месяц назад

      Sure, instead of using bind mounting (volumes) from docker compose , you may simply copy files during the build process in separate Dockerfile for each service . So instead of doing image: php:fpm-alpine, you should create a Dockerfile and build it from that dockerfile. I think i will make some video on this topic soon

  • @KIHUNKIM-d9x
    @KIHUNKIM-d9x 5 месяцев назад

    Thanks for the video!
    I have a task creating php-apache container(php8.1 apache2.4), so i used base image php:8.1-apache, then I was asked to add a php-fpm feature in the same dockerfile. I added a line RUN apt update && apt install -y php-fpm, but it didn't work since my php version is 8.1 and the php-fpm package inside of container was 8.2. I was told use php8.1 version but I couldn't find a php-rpm8.1 package.. any idea? I don't know if this approach is right since I'm very new to docker.

    • @andrewwwlife
      @andrewwwlife  5 месяцев назад

      Please take a look here ruclips.net/video/Z1nFb4kvuJk/видео.html