version: "3"

services:
    alfresco:
        image: ${REPOSITORY_IMAGE}:${REPOSITORY_TAG}
        environment:
            JAVA_OPTS : "
                -Ddb.driver=org.postgresql.Driver
                -Ddb.username=alfresco
                -Ddb.password=alfresco
                -Ddb.url=jdbc:postgresql://postgres:5432/alfresco
                -Dsolr.host=solr6
                -Dsolr.port=8983
                -Dsolr.secureComms=none
                -Dsolr.base.url=/solr
                -Dindex.subsystem.name=solr6
                "
        ports:
            - ${REPOSITORY_PORT}:8080 #Browser port

    share:
        image: ${SHARE_IMAGE}:${SHARE_TAG}
        environment:
            - REPO_HOST=alfresco
            - REPO_PORT=8080
        ports:
            - ${SHARE_PORT}:8080

    postgres:
        image: ${POSTGRES_IMAGE}:${POSTGRES_TAG}
        environment:
            - POSTGRES_PASSWORD=alfresco
            - POSTGRES_USER=alfresco
            - POSTGRES_DB=alfresco
        ports:
            - ${POSTGRES_PORT}:5432

    solr6:
        image: ${SOLR_IMAGE}:${SOLR_TAG}
        environment:
            #Solr needs to know how to register itself with Alfresco
            - SOLR_ALFRESCO_HOST=alfresco
            - SOLR_ALFRESCO_PORT=8080
            #Alfresco needs to know how to call solr
            - SOLR_SOLR_HOST=solr6
            - SOLR_SOLR_PORT=8983
            #Create the default alfresco and archive cores
            - SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive
        ports:
            - ${SOLR_PORT}:8983 #Browser port
            
    firefox:
        image: selenium/standalone-firefox:3.11
        volumes:
            - /dev/shm:/dev/shm
            - /home/bamboo/bamboo-agent-home/xml-data/build-dir/SHARE-SHAR0-ST/share-po:/mnt/share-po
        ports:
            - 4444:4444
        command: ["apt-get upgrade", "&&", "apt-get install maven -y", "&&", "/opt/bin/entry_point.sh &", "&&", "cd /mnt/share-po; mvn -U test -Prun-alfresco,alfresco-one-tests,alfresco-content-services-tests -DskipTests=false  -Dshare.target=http://share:8181/share  -Dshare.url=http://share:8181/share -Dalfresco.server=alfresco -Dalfresco.port=9090 -Dtestng.suite.filename=src/test/resources/testng_share_po.xml -Dwebdriver.grid.url=http://localhost:4444/wd/hub"] 
           
  
