title: How to change php-fpm default port?
body: <p>I'm using <code>php-fpm</code> which runs for default on the port <code>9000</code>. The problem's that I have other docker container based on <code>php-fpm</code>, so I need to change the default port to another one, in order to not confuse <code>nginx</code>.</p>
  <p>This is my <code>Dockerfile</code>:</p>
  <pre><code>FROM php:8.0.2-fpm-alpine
  RUN sed -i 's/9000/9001/' /usr/local/etc/php-fpm.d/zz-docker.conf
  
  WORKDIR /var/www/html
  
  CMD [&quot;php-fpm&quot;]
  
  EXPOSE 9001
  </code></pre>
  <p>I tried to use the <code>sed</code> command to replace the port <code>9000</code> with <code>9001</code>.</p>
  <p>Inside my <code>docker-compose</code> file I have this configuration:</p>
  <pre><code>version: '3.9'
  
  services:
  
    php-fpm:
      container_name: app
      restart: always
      build:
        context: .
        dockerfile: ./docker/php-fpm/Dockerfile
      ports:
        - &quot;9001:9000&quot;
      volumes:
        - ./src:/var/www/html
        - ./docker/php-fpm/config/www.conf:/usr/local/etc/php-fpm.d/www.conf
        - ./src/public:/app/public
        - ./src/writable:/app/writable
  
    nginx:
      image: nginx:stable-alpine
      container_name: nginx
      restart: always
      volumes:
        - ./src:/var/www/html
        - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
        - ./docker/nginx/sites/:/etc/nginx/sites-available
        - ./docker/nginx/conf.d/:/etc/nginx/conf.d
      depends_on:
        - php-fpm
      environment:
        VIRTUAL_HOST: ${HOST}
        LETSENCRYPT_HOST: ${HOST}
        LETSENCRYPT_EMAIL: ${EMAIL}
  </code></pre>
  <p>as you can see I have exposed the port <code>9001</code> also in the <code>docker-compose</code> file.</p>
  <p>The file <code>default.conf</code> available within <code>conf.d</code> folder contains this:</p>
  <pre><code>upstream php-upstream {
      server php-fpm:9001;
  }
  </code></pre>
  <p>the problem's that for some reason, when I load my site I get the error 500. So this means that the stream doesn't send any signal. If I change to port <code>9000</code> everything works, but the stream is wrong 'cause it's the content of another application.</p>
  <p>How can I correctly change the default port?</p>