I've been playing around with docker and docker-compose and have a question.
Currently my docker-compose.yml looks like this:
app:
image: myname/php-app
volumes:
- /var/www
environment:
<SYMFONY_ENVIRONMENT>: dev
web:
image: myname/nginx
ports:
- 80
links:
- app
volumes_from:
- app
App contains php-fpm on port 9000 and my application code. Web is nginx with a few bits of config.
This functions how I would expect it to however in order to connect nginx to php-fpm I have this line:
fastcgi_pass app:9000;
How can I effectively scale this? If I wanted, for example, to have one nginx container running but three app containers running then I'm going to surely have three php-fpm instances all trying to listen on port 9000.
How can I have each php-fpm instance on a different port but still know where they are in my nginx config at any given time?
Am I taking the wrong approach?
Thanks!