Hello,
First of all i want to say im new to Docker.
Docker Version: 19.03.12-ce, running on Manjaro
Im using docker local now to try how it works, but want to use it in the future on my server for future projects.
I did see it works great with load balancing, i can just scale my nginx containers that are behind 1 nginx that i use as proxy/loadbalancer and it works great.
I tried the same for my PHP, by using this in my nginx conf
location ~ \.php$ {
try_files $uri =404;
# Increase valid time in production
resolver 127.0.0.11 valid=5s;
set $upstream php_dev;
# loadbalance PHP
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass $upstream:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
It ‘works’, it does load the pages without problems.
but in the logs i always see php_dev_1 while there are more php_dev_* containers running when i use ‘docker ps’
Second question (Not really important, just hoping to get some keywords so i know what to look for):
How could i scale my MySQL database ?
For NGINX/PHP the files dont really change that often (I use volumes so i can change it in all /var/www/html folders), but with MySQL it has to sync or something.