Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: docker-compose #8

Closed
dirkmoors opened this issue Jul 16, 2015 · 6 comments
Closed

Proposal: docker-compose #8

dirkmoors opened this issue Jul 16, 2015 · 6 comments

Comments

@dirkmoors
Copy link

Hello,

I've created a docker-compose setup, together with a 'install kong from git source' Dockerfile.
https://github.com/vikingco/docker-kong

Is that something you guys can use? Then we might consider integrating my approach into this repository (and deprecating my repository)

Cheers

@subnetmarco
Copy link
Member

Hi @dirkmoors - sorry for the super late update. Docker compose is a nice addition. Do you think you can update your example with the latest 0.6.1 release?

Happy to merge this into our repo.

@ambrons
Copy link

ambrons commented Feb 23, 2016

@thefosk if @dirkmoors doesn't I don't mind picking up the torch there. I'm half way through as it is of doing almost the same thing.

@fakraemer
Copy link

This will not work with a cold cassandra container, since cassandra is still bootstrapping whilst it is linked into the kong container. With docker-compose stop && docker-compose rm -f && docker-compose up I get:

kong_1           | [ERR] Cassandra error: All hosts tried for query failed. cassandra:9042: connection refused for socket with peer cassandra:9042.
kong_1           | [ERR] Could not start Kong

This is due to a lack in feature of docker really, it should allow you to listen for exposed ports to be opened. So for the moment being I would suggest a small bootstrap wrapper on the kong container. The following works for me, but you might want to add some timeout on that loop to catch missconfiguration (e.g. wrong alias/missing cassandra):

kong-cassandra:
  image: cassandra:2.2.4
kong:
  image: mashape/kong
  links:
    - kong-cassandra:cassandra
  ports:
    - 8000:8000
    - 8001:8001
  command: sh -c 'until nc --recv-only -i 0.1 cassandra 9042 2>&1 >/dev/null|grep timeout >/dev/null; do :; done; kong start && tail -f /usr/local/kong/logs/error.log'

At this point, it would probably be best to use entrypoint instead of command on the kong image in order to avoid the extra shell.

@subnetmarco
Copy link
Member

since cassandra is still bootstrapping whilst it is linked into the kong container

Somebody suggested using restart: always to make this work.

@DonMartin76
Copy link

Or use dockerize to make the container wait for Cassandra before kong start is issued.

@subnetmarco
Copy link
Member

subnetmarco commented Aug 23, 2016

Available now for 0.9 in the compose folder :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants