Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-14120

Defer build until service containers are running like docker compose

    XMLWordPrintable

    Details

    • Feedback Policy:

      Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Description

      We want to compose multiple services using Docker, configured via environment variables and talk to each via links.

      Here is an (anonymized) example of our docker-compose file:

      #!yml
      
      # Run using scripts in ../bin/ to set env vars correctly
      
      version: '2'
      services:
        service-a:
          container_name: ${SERVICE_ID}
          image: ${DOCKER_IMAGE}
          ports:
            - ${PORT}:${PORT}
          environment:
            - DYNAMO_AWS_REGION=ap-southeast-2
            - DYNAMO_ENDPOINT=http://dynamo:8006
            - DYNAMO_TABLE_NAME=table
            - SQS_LOCAL_PORT=9324
            - SPRING_PROFILES_ACTIVE=local,docker
      
          depends_on:
            - service-b
            - db2
            - elasticmq-sqs
          links:
            - db2:dynamo
            - elasticmq-sqs:sqs
      
        db2:
          container_name: ${SERVICE_ID}-dynamo
          image: tray/dynamodb-local
          ports:
            - 8006:8006
          command: -inMemory -port 8006 -sharedDb
      
        service-b:
          container_name: service-b
          image: someImage:1.0.0-SNAPSHOT
          environment:
            - DYNAMO_AWS_REGION=ap-southeast-2
            - DYNAMO_AWS_ENDPOINT=http://dynamodb:8005
            - DYNAMO_TABLE_NAME=table
          ports:
            - 8085:8085
          depends_on:
            - db1
          links:
            - db1:dynamodb
      
        db1:
          container_name: db1
          image: tray/dynamodb-local
          ports:
            - 8005:8005
          command: -inMemory -port 8005 -sharedDb
      
        elasticmq-sqs:
          image: tddmonkey/elasticmq
          ports:
            - 9324:9324
      
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            crolf Christian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: