Docker Community Forums

Share and learn in the Docker community.

Running Magento2+MariaDB in Docker but localhost shows local apache

Hello there, I’m running Magento2 and MariaDB in docker containers on macOS Mojave. No problem so far, but no matter what port I’ve chosen to expose Magento to the host system, the browser redirects to the local apache’s document root like this:

input: localhost:8090 (or any other published port that maps to docker’s port 80)
redirection: 127.0.0.1/index-php-from-local-project-inside-of-apache-documentRoot

The redirection occurs even if apache server is stopped.

Other projects running on the same host system, e.g. NodeJS or GraphQL servers, run perfectly fine on whatever port I’ve chosen. Can someone point out to me how to resolve the conflict?