version: '3.9'

services:
  browser:
    image: {{ env.CRAWLER_IMAGE }}
    command:
      - create-login-profile
      - --interactive
      - --filename
      - /tmp/profile.tar.gz
      - --url
      - "{{ url }}"
      {%- if env.PROFILE_FILENAME %}
      - --profile
      - "@{{ env.PROFILE_FILENAME }}"
      {%- endif %}   


    hostname: "browser-{{ id }}-0.browser-{{ id }}"
    networks:
      - btrix

    deploy:
      endpoint_mode: dnsrr
      replicas: 1
      labels:
        browser: {{ id }}
        role: browser

    environment:
      STORE_ENDPOINT_URL: "{{ env.STORE_ENDPOINT_URL }}"
      STORE_ACCESS_KEY: "{{ env.STORE_ACCESS_KEY }}"
      STORE_SECRET_KEY: "{{ env.STORE_SECRET_KEY }}"

      STORE_PATH: "{{ env.STORE_PATH }}"
 
      
networks:
  btrix:
    external: 
      name: btrix-net

