version: "3.8" services: localstack: image: localstack/localstack:latest environment: - AWS_DEFAULT_REGION=eu-central-1 - EDGE_PORT=4566 - SERVICES=dynamodb,s3,ssm ports: - '4566:4566' volumes: - "${TMPDIR:-/tmp/localstack}:/tmp/localstack" - "/var/run/docker.sock:/var/run/docker.sock" setup: image: mesosphere/aws-cli environment: - AWS_ACCESS_KEY_ID=dummyaccess - AWS_SECRET_ACCESS_KEY=dummysecret - AWS_DEFAULT_REGION=eu-central-1 entrypoint: /bin/sh -c command: > " sleep 10; aws --endpoint-url=http://localstack:4566 s3 mb s3://petsearch; aws --endpoint-url=http://localstack:4566 ssm put-parameter --name /petstore/dynamodbtablename --type String --value petsearch; aws --endpoint-url=http://localstack:4566 ssm put-parameter --name /petstore/s3bucketname --type String --value petsearch; aws --endpoint-url=http://localstack:4566 dynamodb create-table --table-name petsearch --key-schema AttributeName=petid,KeyType=HASH --attribute-definitions AttributeName=petid,AttributeType=S --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5; aws --endpoint-url=http://localstack:4566 dynamodb put-item --table-name petsearch --item '{\"petid\":{\"S\":\"aaaa\"},\"pettype\":{\"S\":\"kitten\"},\"petcolor\":{\"S\":\"braun\"},\"availability\":{\"S\":\"now\"},\"cuteness_rate\":{\"S\":\"high\"},\"price\":{\"S\":\"200\"},\"image\":{\"S\":\"k1\"}}'; aws --endpoint-url=http://localstack:4566 dynamodb put-item --table-name petsearch --item '{\"petid\":{\"S\":\"bbbb\"},\"pettype\":{\"S\":\"bunny\"},\"petcolor\":{\"S\":\"black\"},\"availability\":{\"S\":\"now\"},\"cuteness_rate\":{\"S\":\"high\"},\"price\":{\"S\":\"150\"},\"image\":{\"S\":\"b1\"}}'; aws --endpoint-url=http://localstack:4566 dynamodb put-item --table-name petsearch --item '{\"petid\":{\"S\":\"cccc\"},\"pettype\":{\"S\":\"puppy\"},\"petcolor\":{\"S\":\"white\"},\"availability\":{\"S\":\"now\"},\"cuteness_rate\":{\"S\":\"high\"},\"price\":{\"S\":\"500\"},\"image\":{\"S\":\"p1\"}}'; " depends_on: - localstack collector: image: public.ecr.aws/aws-observability/aws-otel-collector:v0.17.1 command: ["--config=/etc/ecs/ecs-default-config.yaml", "--log-level=INFO"] environment: - AWS_DEFAULT_REGION=us-east-1 - AWS_ACCESS_KEY - AWS_SECRET_KEY - AWS_REGION=us-east-1 ports: - "1777:1777" # pprof extension - "55679:55679" # zpages extension - "13133" # health_check - "4317" pet-search: build: . environment: - AWS_REGION=eu-central-1 - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:55680 - AWS_ACCESS_KEY=dummyaccess - AWS_SECRET_KEY=dummysecret ports: - "8080:80" depends_on: - setup - collector entrypoint: /bin/sh -c command: > " java -jar /app/app.jar \\ --cloud.aws.region.static="eu-central-1" \\ --aws.local.endpoint=http://localstack:4566 "