serverless-plugins
serverless-plugins copied to clipboard
right way to run sqs offline within docker-compose
I have an issue connecting to elasticMQ from docker-compose
docker-compose.yml
version: "3.5"
services:
myService:
build: .
command: npm run offline
container_name: myService
image: myService-image
ports:
- "8001:8001"
- "3006:3006"
depends_on:
- "elasticmq"
elasticmq:
image: "softwaremill/elasticmq"
container_name: elasticmq
ports:
- "9324:9324"
serverless.yml:
serverless-offline-sqs:
autoCreate: true # create queue if not exists
apiVersion: '2012-11-05'
endpoint: http://elasticmq:9324
region: eu-west-1
accessKeyId: root
secretAccessKey: root
skipCacheInvalidation: false
```
so the issue is when I try accessing elasticmq via `http://elasticmq:9324`, it says the host is not accessible. however, if I write the endpoint as endpoint: `elasticmq:9324` (https by default) elasticMQ container will complain about accessing it as http where it should be https.
`Perhaps this was an HTTPS request sent to an HTTP endpoint? error fron elasticMQ console`
can you help pls?
Your configuration should work, you could try by adding an alias with the link property
https://docs.docker.com/compose/networking/#links