I built two WordPress websites, one bound to port 9000 and one to 8000. They are both connected to the same MySQL database.
When I access the port 8000 it works perfectly and connects to both the website and the database.
On the other side, when I access the port 9000 it just automatically redirects me to the port 8000 and to its website. Any reason why this may happen?
This is the docker-compose file:
Tried to clear the cache and tried it on Firefox (default browser is Chrome) but it still happens.
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
second_wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "9000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
db_data: {}