fix autostart and add support for docker compose#242
Conversation
steffyP
left a comment
There was a problem hiding this comment.
Nice set of changes @pinzon! Having this docker-compose feature will certainly be nice for a lot of people, and it makes the serverless plugin more user-friendly 🥳
We already went to some things together and I continued testing afterwards, here are some things I found (some we already discussed):
-
for the
autouse(old docker functionality): the-dflag is not working on my docker version. thedocker createdoes not have an option-d, maybe this is a leftover? If you have the same issue, I would like to fix this with this PR as well -
there is a
docker-compose.ymlon the root level of this project - I think we should adapt it as well with this PR, so that people actually have an up-to-date template of the compose file -
the start of the
docker-composefile isn't working for me, I had to addup -din order to make it work (see also inline comment) -
we may have another issue with the the
getContainerfunction, as the image name may belocalstack/localstack-pro. I think we should add a check here and try both image names
Line #416:
const getContainer = () => {
return exec('docker ps').then(
(stdout) => {
const exists = stdout.split('\n').filter((line) => line.indexOf('localstack/localstack') >= 0 || line.indexOf('localstack_localstack') >= 0);
if (exists.length) {
return exists[0].replace('\t', ' ').split(' ')[0];
}
}
)
};
Co-authored-by: steffyP <steffyP@users.noreply.github.com>
Co-authored-by: steffyP <steffyP@users.noreply.github.com>
This pull request addresses the issue outlined in #153, where LocalStack was inadvertently initiating a container despite the plugin being inactive.
Additionally, it introduces a new capability (requested in #75): instead of initiating a container through the LocalStack CLI or Docker bin, users can now specify a Docker Compose file to be utilized during the autostart phase. This enhancement provides more flexibility and control over the containerization process.