serverless-localstack
serverless-localstack copied to clipboard
Use `docker-compose.yml` for `autostart: true`
The current implementation depends on user having to install localstack binary on their machine since it uses the following command (https://github.com/localstack/serverless-localstack/blob/master/src/index.js#L332) to start docker container.
localstack infra start --docker
This repo comes with a docker-compose.yml but it's not used at all.
IMHO, when auto-starting it should use the docker-compose.yml as the default way to start docker container. The reason being, I want to use locastack but I don't want to install the binary locally on my machine. That's the essence of using docker containers.
I also face this problem. I am wondering if you solve this.
I also face this problem. I am wondering if you solve this.
I have actually decided for my use case, I could live without localstack. I guess I did not have time to explore this more since maintainers on the project did not comment.
Thanks for reporting @azizur @wirelessr , and apologies for the delay. Please note that pull requests are highly welcomed and encouraged, if you'd like to see a certain functionality being added!
To explore your proposal a bit more - I guess we could add a configuration switch that allows users to define whether they want to use the localstack command line versus the docker-compose command. (Please note that not all users may have docker-compose installed, either).
@wirelessr Do you think you could try to create a pull request to add this functionality? We'd be happy to provide help and guidance, as needed. Thanks for your help!
Hi @azizur, hi @wirelessr,
we just released version 1.2.0, where you can now configure a docker-file path to start LocalStack using docker-compose. Please check the README for details, but it a nutshell you can set:
service: myService
plugins:
- serverless-localstack
custom:
localstack:
autostart: true
docker:
compose_file: /home/localstack_compose.yml # path to the docker-compose file
...
Please let us know if you still encounter any issues!