Details
-
Suggestion
-
Resolution: Won't Fix
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