version: '2'

services:

    main:
        build: .
        volumes: 
            - /var/run/docker.sock:/var/run/docker.sock
        depends_on:
            - puffindb
            - dns
            - mailhog
        ports: 
            - "8080:8080"
        command: 
            - "db create"
            - "db upgrade"
            - "user create puffin"
            - "machine proxy"
            - "machine mail"
            - "machine dns"
            - "server"
        networks:
            - front
            - back
            - default
    
    puffindb:
        image: postgres
        ports:
            - 5432
        networks:
            back:
    
    dns:
        image: loomchild/dns
        ports: 
            - 53:53/udp
        networks:
            back:

    dnsfix:
        image: sequenceiq/alpine-dig
        entrypoint: ["/bin/sh", "-c", "echo nameserver `dig +short dns` > /etc/resolv.conf"]
        network_mode: "service:main"

    mailhog:
        image: mailhog/mailhog
        ports: 
            - "8025:8025"
            - 1025
        networks:
            front:
            back:

networks:
    
    front:
    back:

version: '2'

services:

    main:
        build: .
        volumes: 
            - /var/run/docker.sock:/var/run/docker.sock
        depends_on:
            - puffindb
            - dns
            - mailhog
        ports: 
            - "8080:8080"
        networks:
            - front
            - back
            - default
    
    puffindb:
        image: postgres
        ports:
            - 5432
        networks:
            back:
    
    dns:
        image: loomchild/dns
        ports: 
            - 53:53/udp
        networks:
            back:

    dnsfix:
        image: sequenceiq/alpine-dig
        entrypoint: ["/bin/sh", "-c", "echo nameserver `dig +short dns` > /etc/resolv.conf"]
        network_mode: "service:main"

    mailhog:
        image: mailhog/mailhog
        ports: 
            - "8025:8025"
            - 1025
        networks:
            front:
            back:

networks:
    
    front:
    back:

Remove useless puffin machine dns command
Remove useless puffin machine dns command
