version: "2"

services:
  web:
    image: alpine:3.10.1
    command: top
    networks: ["front"]
  app:
    image: alpine:3.10.1
    command: top
    networks: ["front", "back"]
    links:
      - "db:database"
  db:
    image: alpine:3.10.1
    command: top
    networks: ["back"]

networks:
  front: {}
  back: {}
