version: "3.2"
services:
    contest:
        build:
            context: .
            dockerfile: docker/contest/Dockerfile
        command: bash -c "cd /go/src/github.com/facebookincubator/contest/cmds/contest/ && go run . -dbURI 'contest:contest@tcp(dbstorage:3306)/contest_integ?parseTime=true'"
        ports:
            - 8080:8080
        depends_on:
            - mariadb
        networks:
            - net

    mariadb:
        environment:
            - MARIADB_RANDOM_ROOT_PASSWORD=true
        build:
            context: .
            dockerfile: docker/mariadb/Dockerfile
        ports:
            - 3306:3306
        networks:
            net:
                aliases:
                    - dbstorage

networks:
    net:
