version: '2'
services:
    mysql.local:
        image: keybaseprivate/mysql
        restart: unless-stopped
        environment:
            - MYSQL_ROOT_PASSWORD=secret
            - MYSQL_DATABASES=gregor
        ports:
            - "3306"
        command: ["--innodb_print_all_deadlocks=1"]
    kbweb.local:
        image: keybaseprivate/kbweb
        ports:
            - "3000:3000"
            - "13009"
            - "13010"
        links:
            - mysql.local
            - gregor.local
            - sqsd.local
        entrypoint: ["run/startup_for_container.sh"]
        environment:
            - KEYBASE_RUN_MODE=devel
            - KEYBASE_NO_GREGORD_LAUNCH=true
            - KEYBASE_GREGORD_HOSTNAME=gregor.local
            - MYSQL_HOST=mysql.local
        logging:
            driver: json-file
            options:
                max-size: 50m
                max-file: "2"
    gregor.local:
        image: keybaseprivate/kbgregor
        ports:
            - "9911:9911"
        restart: unless-stopped
        links:
            - mysql.local
        environment:
            - GREGOR_BIND_ADDRESS=0.0.0.0:9911
            - GREGOR_AUTH_SERVER=fmprpc://kbweb.local:13009
            - MYSQL_DSN=root:secret@tcp(mysql.local:3306)/keybase
            - CHAT_MYSQL_DSN=root:secret@tcp(mysql.local:3306)/keybase
            - GREGOR_TLF_SERVER=fmprpc+tls://kbweb.local:13010
            - GREGOR_TLFAUTH_PRIVATE_SIGNING_KEY=e20589b8cd66d447aaee44b587305bd521f34f3085709b32b4e3bd479b20253e59ea153c88a8ea524d39e0ae58fa195749214b38a28fdb4229ba3390b2d33e86
            - GREGOR_TLFAUTH_PUBLIC_SIGNING_KEY=012059ea153c88a8ea524d39e0ae58fa195749214b38a28fdb4229ba3390b2d33e860a
        logging:
            driver: json-file
            options:
                max-size: 50m
                max-file: "2"
    sqsd.local:
        image: keybaseprivate/sqsd
        restart: unless-stopped
        ports:
            - "9324"
