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

[bitnami/php-fpm] nginx & php-fpm images with podman compose - nginx container crashes on start #65285

Closed
trymeouteh opened this issue Apr 20, 2024 · 5 comments
Assignees
Labels
php-fpm solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@trymeouteh
Copy link

trymeouteh commented Apr 20, 2024

Name and Version

docker.io/bitnami/php-fpm:8.3.6

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Install Podman (I am using Podman 4.8.2)
  2. Use podman compose to create containers

compose.yml

version: '3'
services:
    nginx:
        image: docker.io/bitnami/nginx
        volumes:
            - ./nginx.conf:/opt/bitnami/nginx/conf/server_blocks/my_server_block.conf:ro
            - .:/app/
        ports:
            - 8080:8080
        networks:
            - app-tier
        depends_on:
            - phpfpm
    phpfpm:
        image: docker.io/bitnami/php-fpm
        volumes:
            - .:/app/
        networks:
            - app-tier
networks:
  app-tier:
    driver: bridge

nginx.conf

server {
    server_name localhost;
    listen 8080;
    
    root /app/www/public;

    index index.php index.html index.htm;
    autoindex on;

    location ~ \.php$ {
        fastcgi_pass phpfpm:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
} 

What is the expected behavior?

To have both the nginx and phpfpm container in the podman compose to run without any issues

What do you see instead?

This is the error I get from the nginx container that causes the container to crash when it starts.

nginx 03:15:56.00 INFO  ==> ** Starting NGINX **
2024/04/19 03:15:56 [emerg] 1#1: host not found in upstream "phpfpm" in /opt/bitnami/nginx/conf/server_blocks/my_server_block.conf:19
nginx: [emerg] host not found in upstream "phpfpm" in /opt/bitnami/nginx/conf/server_blocks/my_server_block.conf:19

Additional information

I am using podman cli 4.8.2 with podman desktop on Manjaro. I am trying to create a nginx container with phpfpm using the bitnami images from docker.io. I followed the instructions bitnami/nginx image and got it working with my own nginx configuration file. However I did follow the instructions to make bitnami/php-fpm work with bitnami/nginx and I cannot get it to work with podman compose.

Something to do with the nginx.conf file with the PHP configuration? However I did make sure it fastcgi_pass phpfpm:9000;

To my understanding it is due to Podman's use of networks. The nginx container is unable to communicate to the phpfpm container. I have fiddle around with the network setup in the compose file but setting the two containers to share the host network which did allow the nginx container to start up and stay running but when I go to a PHP page in my browser on localhost:8080, it will not load the PHP web page.

What am I doing wrong?

@trymeouteh trymeouteh added the tech-issues The user has a technical issue about an application label Apr 20, 2024
@github-actions github-actions bot added the triage Triage is needed label Apr 20, 2024
@javsalgar javsalgar changed the title nginx & php-fpm images with podman compose - nginx container crashes on start [bitnami/php-fpm] nginx & php-fpm images with podman compose - nginx container crashes on start Apr 22, 2024
@javsalgar
Copy link
Contributor

Hi!

Is the issue happening without podman? Following these instructions using vanilla docker? https://github.com/bitnami/containers/tree/main/bitnami/php-fpm#step-1-create-a-network

@trymeouteh
Copy link
Author

trymeouteh commented Apr 24, 2024

Hello,

I did the same steps in my original post but with this additonal step with docker instead of podman

docker network create app-tier --driver bridge

And I had no issues. The steps in my original post are the same as the steps in these instructions.
https://github.com/bitnami/containers/tree/main/bitnami/php-fpm#step-1-create-a-network

I also tried doing these steps with podman network create before I use podman compose up and I still get the same error when using podman over docker.

@javsalgar
Copy link
Contributor

Ok, so if I understand correctly, the issue is only happening in podman, as you found no issues when using docker. My advice in this case would be to report it in podman developers. I will leave this ticket open to see if someone from the community wants to share their experience with podman, but this platform is not something we actively test and support.

Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label May 11, 2024
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
php-fpm solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

3 participants