services: binary: build: dockerfile: Dockerfile.backend context: . environment: OBS_COMPONENT: binary OBS_SRC_SERVER: http://{{ (groups['obs_source'][0] | extract(hostvars))['ansible_host'] }}:{{ (groups['obs_source'][0] | extract(hostvars))['SRC_PORT'] }} OBS_REPO_SERVER: http://{{ ansible_host }}:{{ PORT }} OBS_SERVICE_SERVER: http://{{ (groups['obs_source'][0] | extract(hostvars))['ansible_host'] }}:{{ (groups['obs_source'][0] | extract(hostvars))['SRV_PORT'] }} ports: - 0.0.0.0:{{ PORT }}:5252 - 0.0.0.0:{{ REPO_PORT }}:80 volumes: - /srv/obs/run - ./volume/binary:/srv/obs/ - ./volume/log:/var/log/supervisord restart: unless-stopped