0
I have a question about the communication between containers, in my Docker-Compose I am creating a link between the container web and mysql. This link would be an internal network?
If not, it would be more performative to create an internal network?
Docker-Compose.yml
version: "3.3"
services:
  mysql:
    container_name: mysql
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: SENHA
      MYSQL_DATABASE: webApp
      MYSQL_USER: root
      MYSQL_PASSWORD: senha
    restart: always
    ports:
      - 3306:3306
  web:
    container_name: web
    image: web_dev
    build:
      context: .
      dockerfile: Dockerfile-web
    volumes:
      - ../Desenvolvimento Web/:/var/www
      - ./Apache/:/etc/apache2/sites-enabled/
    working_dir: /var/www
    depends_on:
      - mysql
    links:
      - mysql
    restart: always
    ports:
      - 80:80
It is not the same doubt as yours, but I answered something in this sense here, about the networks in a Compose: https://answall.com/questions/243881/docker-compose-link/243957#243957
– Bruno César
I didn’t understand it very well. This instruction Links that I used, does exactly what?
– Fábio Jânio