"docker-compose up" sporadic race condition
Sporadic Race condition when doing cd api && npm install && docker-compose up -d API doesn't start because Eventstore isn't up yet. (Workaround: docker-compose restart api)
Does it happen on the first run too? After the first time, if I make any changes to the EMD file and run the following commands, I don't see my changes in swagger (containers are not restarted)
les convert && les-node -b && cd api && npm install && docker-compose up -d
I'm wondering if the --force-recreate flag should be added to the docker-compose up. (This is what I had to do to be able to see my changes). As per the docker documentation, it doesn't seem like docker-compose up would recreate the containers in this case:
If there are existing containers for a service, and the service’s configuration or image was changed after the container’s creation, docker-compose up picks up the changes by stopping and recreating the containers (preserving mounted volumes). To prevent Compose from picking up changes, use the --no-recreate flag. If you want to force Compose to stop and recreate all containers, use the --force-recreate flag.
ref: https://docs.docker.com/compose/reference/up/
Yes, it happens on the first run too.
Thanks for the '--force-recreate' suggestion - yes. I've updated the README.
R.
@robertreppel Created a PR in the template repo to address this: https://github.com/Adaptech/les-node-template/pull/1