version: '2'

networks:
  v6d:
    external: true
  buildbot-db: {}
  buildbot-worker: {}

services:
  buildbot:
    image: "buildbot-master-parrrate"
    build: ../master
    env_file:
      - db.env
      - gitea.env
    environment:
      - BUILDBOT_CONFIG_DIR=config
      - BUILDBOT_CONFIG_URL=https://gitea.parrrate.ru/PTV/buildabot/archive/master.tar.gz
      - BUILDBOT_WORKER_PORT=9989
      - BUILDBOT_WEB_URL=http://192.168.1.3:8010/
      - BUILDBOT_WEB_PORT=tcp:port=8010
    depends_on:
      - db
    ports:
      - "8010:8010"
    networks:
      - v6d
      - buildbot-db
      - buildbot-worker
  
  db:
    env_file:
      - db.env
    image: "postgres:9.4"
    expose:
      - 5432
    networks:
      - buildbot-db

  worker:
    image: "buildbot-worker-parrrate-rust"
    build: ../worker
    environment:
      BUILDMASTER: buildbot
      BUILDMASTER_PORT: 9989
      WORKERNAME: example-worker
      WORKERPASS: pass
      WORKER_ENVIRONMENT_BLACKLIST: DOCKER_BUILDBOT* BUILDBOT_ENV_* BUILDBOT_1* WORKER_ENVIRONMENT_BLACKLIST
    networks:
      - buildbot-worker