services:
  mydb:
    image: mariadb
    network_mode: "service:db"
    environment:
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  db:
    image: gtardif/sentences-db
    init: true
    networks:
      - dbnet
      - closesnetworkname1
      - closesnetworkname2
  words:
    image: gtardif/sentences-api
    init: true
    ports:
      - "8080:8080"
    networks:
      - dbnet
      - servicenet
  web:
    image: gtardif/sentences-web
    init: true
    ports:
      - "80:80"
    labels:
      - "my-label=test"
    networks:
      - servicenet

networks:
  dbnet:
  servicenet:
    name: microservices
  closesnetworkname1:
    name: closenamenet
  closesnetworkname2:
    name: closenamenet-2
