GithubHelp home page GithubHelp logo

compy / kong Goto Github PK

View Code? Open in Web Editor NEW

This project forked from henriquecd/kong-docker

0.0 1.0 0.0 47 KB

Kong docker image that easily installs plugins from source code.

License: GNU General Public License v3.0

Shell 6.51% Lua 90.71% Dockerfile 2.78%

kong's Introduction

kong

Kong with custom plugin

The Docker image generated by the Dockerfile contains a kong custom plugin that extract roles from a JWT token and make a request for a Policy Decision Point (PDP)

An example of how to associate a previously created service to the plugin:

kong="http://kong:8001"
service_name="service_example"
url_pdp="http://auth:5000/pdp"

curl -X POST \
--url ${kong}/services/${service_name}/plugins/ \
--data "name=pepkong" \
--data "config.pdpUrl=${url_pdp}"

The configuration below shows how the image can be used with docker-compose:

version: '3.7'
services:

  db:
    image: dojot/postgres:9.5.21-alpine
    environment:
      POSTGRES_DB: kong
      POSTGRES_USER: kong
      POSTGRES_PASSWORD: kong
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "kong"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: on-failure

  kong:
      image:  kong_dojot
      user: "kong"
      depends_on:
        - db
      environment:
        KONG_ADMIN_ACCESS_LOG: /dev/stdout
        KONG_ADMIN_ERROR_LOG: /dev/stderr
        KONG_ADMIN_LISTEN: '0.0.0.0:8001'
        KONG_CASSANDRA_CONTACT_POINTS: postgres
        KONG_DATABASE: postgres
        KONG_PG_HOST: db
        KONG_PG_USER: kong
        KONG_PG_DATABASE: kong
        KONG_PG_PASSWORD: kong
        KONG_PROXY_ACCESS_LOG: /dev/stdout
        KONG_PROXY_ERROR_LOG: /dev/stderr
        KONG_LOG_LEVEL: info
      ports:
        - "8000:8000/tcp"
        - "127.0.0.1:8001:8001/tcp"
        - "8443:8443/tcp"
        - "127.0.0.1:8444:8444/tcp"
      healthcheck:
        test: ["CMD", "kong", "health"]
        interval: 10s
        timeout: 10s
        retries: 10
      restart: on-failure

kong's People

Contributors

andersonluisribeiro avatar giovannicuriel avatar henriquecd avatar mmagr avatar mprevide avatar raulnegreiros avatar

Watchers

 avatar

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.