containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.84k stars 2.42k forks source link

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

Closed trymeouteh closed 4 months ago

trymeouteh commented 6 months ago

Issue Description

Describe your issue

Unable to get the bitmani nginx + php images to work in podman. I am able to get these images to work togeather in Docker and I can get the bitnami nginx image by itself to work in podman.

Steps to reproduce the issue

Steps to reproduce the issue

  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;
    }
} 

Describe the results you received

Describe the results you received

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

Describe the results you expected

Describe the results you expected

No errors

podman info output

If you are unable to run podman info for any reason, please provide the podman version, operating system and its version and the architecture you are running.

- Podman 4.8.2
- Manjaro Linux
- amd64

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Additional environment details

None

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

https://github.com/bitnami/containers/issues/65285

github-actions[bot] commented 5 months ago

A friendly reminder that this issue had no activity for 30 days.

Luap99 commented 4 months ago

First make sure you are using the latest version of podman, netavark, aardvark-dns and then you have to make sure phpfpm is started before the nginx container. I have no idea if podman-compose does that for you. We do not directly support podman-compose here so you better ask in the podman-compose repo or try use docker-compose against the podman socket.

Or you create a reproducer with the just the podman commands so I can take a look but for now I am going to close this as I don't think the issue is in podman.