les icon indicating copy to clipboard operation
les copied to clipboard

"docker-compose up" sporadic race condition

Open robertreppel opened this issue 7 years ago • 3 comments

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)

robertreppel avatar Apr 14 '18 18:04 robertreppel

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/

mohkami avatar Apr 22 '18 05:04 mohkami

Yes, it happens on the first run too.

Thanks for the '--force-recreate' suggestion - yes. I've updated the README.

R.

robertreppel avatar Apr 22 '18 20:04 robertreppel

@robertreppel Created a PR in the template repo to address this: https://github.com/Adaptech/les-node-template/pull/1

mohkami avatar May 20 '18 21:05 mohkami