Git Product home page Git Product logo

Comments (6)

subnetmarco avatar subnetmarco commented on May 17, 2024

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.

from docker-kong.

ambrons avatar ambrons commented on May 17, 2024

@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.

from docker-kong.

fakraemer avatar fakraemer commented on May 17, 2024

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.

from docker-kong.

subnetmarco avatar subnetmarco commented on May 17, 2024

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

Somebody suggested using restart: always to make this work.

from docker-kong.

DonMartin76 avatar DonMartin76 commented on May 17, 2024

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

from docker-kong.

subnetmarco avatar subnetmarco commented on May 17, 2024

Available now for 0.9 in the compose folder :)

from docker-kong.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.