services: mydb: image: mariadb network_mode: 'service:db' environment: - MYSQL_ALLOW_EMPTY_PASSWORD=yes db: image: gtardif/sentences-db networks: - dbnet - closesnetworkname1 - closesnetworkname2 words: image: gtardif/sentences-api ports: - '8080:8080' networks: - dbnet - servicenet web: image: gtardif/sentences-web ports: - '80:80' labels: - 'my-label=test' networks: - servicenet networks: dbnet: servicenet: name: microservices closesnetworkname1: name: closenamenet closesnetworkname2: name: closenamenet-2