Docker Compose | Virtual Hosts

admin

Administrator
Staff member
Whats wrong in my code? thanks in advance!

I'm trying to set up a virtual host for my docker container.
On localhost: 8000 works perfectly, but when I try to access through http: //borgesmelo.local/ the error ERR_NAME_NOT_RESOLVED appears, what can be missing?

This is my -> docker-compose.yml

Code:
version: '3.3'

services:

      borgesmelo_db:
            image: mariadb:latest
            container_name: borgesmelo_db
            restart: always
            volumes:
                  -  ./mariadb/:/var/lib/mysql

            restart: always
            environment:
                  MYSQL_ROOT_PASSWORD: [email protected]#Sql
                  MYSQL_PASSWORD: [email protected]#Sql

      borgesmelo_ws:
            image: richarvey/nginx-php-fpm:latest
            container_name: borgesmelo_ws
            restart: always
            volumes:
                  -  ./public/:/var/www/html
            ports:
                  - "8000:80"

      borgesmelo_wp:
            image: wordpress:latest
            container_name: borgesmelo_wp
            volumes:
                  -  ./public/:/var/www/html
            restart: always
            environment:
                  VIRTUAL_HOST: borgesmelo.local
                  WORDPRESS_DB_HOST: borgesmelo_db:3306
                  WORDPRESS_DB_PASSWORD: [email protected]#Sql
            depends_on:
                  - borgesmelo_db
                  - borgesmelo_ws

      borgesmelo_phpmyadmin:
            image: phpmyadmin/phpmyadmin:latest
            container_name: borgesmelo_phpmyadmin
            links:
                  - borgesmelo_db
            ports:
                  - "8001:80"
            environment:
                  - PMA_ARBITRARY=1

      borgesmelo_vh:
            image: jwilder/nginx-proxy
            container_name: nginx-proxy
            ports:
                  - "8002:80"
            volumes:
                  - /var/run/docker.sock:/tmp/docker.sock:ro
networks:
  default:
    external:
      name: nginx-proxy

This is my hosts file (/etc/hosts) [macOS]

Code:
#DOCKER
127.0.0.1:8000          borgesmelo.local