I am going to make a server pack using podman in my local machine (Fedora 31 KDE). The pack includes:
- Web server (image: php:7.2-apache, volume: $VARIABLE:/var/www/html:Z)
- MySQL server (image: mysql:8, volume: /var/lib/mysql:/var/lib/mysql:Z)
- Another web server (image: phpmyadmin/phpmyadmin:5)
Now, I need a way to be able to start the 3 servers with a single command as well as stop with a single command. Therefore, I created a pod and put them under the pod. I need access to both the main web server and phpmyadmin server from the host. Here is a bash script I am usig to create them:
#!/usr/bin/env sh
if [ "$1" != "" ];then
WEB_PATH="-v $1:/var/www/html:Z"
fi
sudo podman pod create -n servers -p 80:80 -p 8080:80
sudo podman run -dt --pod servers --rm --name web $WEB_PATH php:7.2-apache
sudo podman run -dt --pod servers --rm --name mysql --env MYSQL_ROOT_PASSWORD=iamroot -v /var/lib/mysql:/var/lib/mysql:Z mysql:8
sudo podman run -dt --pod servers --rm --name pma phpmyadmin/phpmyadmin:5
The problem is, 1st and 3rd both servers use port 80 as their default. I cannot figure out this problem.
I need access the main web server on port 80 and pma server on port 8080 from the host.