services:
  localstack:
    image: localstack/localstack:4.13
    ports:
      - '4566:4566'
    environment:
      - SERVICES=lambda,sqs,kms,secretsmanager,logs
      - LAMBDA_EXECUTOR=docker
      - LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT=60
      - DEBUG=0
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock'
    healthcheck:
      test: ['CMD', 'curl', '-f', 'http://localhost:4566/_localstack/health']
      interval: 5s
      timeout: 5s
      retries: 20

  redis:
    image: redis:7-alpine
    ports:
      - '6379:6379'
    healthcheck:
      test: ['CMD', 'redis-cli', 'ping']
      interval: 5s
      timeout: 3s
      retries: 20

  httpbin:
    image: mccutchen/go-httpbin
    ports:
      - '8080:8080'
    healthcheck:
      test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:8080/status/200']
      interval: 5s
      timeout: 3s
      retries: 10
