Last active
April 26, 2022 14:45
-
-
Save italopinto/e3b83c57c63cb9a7e7347fe8aae2335b to your computer and use it in GitHub Desktop.
Kong declarative settings demo, with demo credentials in header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
kong: | |
container_name: kong | |
image: kong:latest | |
volumes: | |
- ./kong.yml:/kong/declarative/kong.yml | |
environment: | |
- KONG_DATABASE=off | |
- KONG_DECLARATIVE_CONFIG=/kong/declarative/kong.yml | |
- KONG_PROXY_ACCESS_LOG=/dev/stdout | |
- KONG_ADMIN_ACCESS_LOG=/dev/stdout | |
- KONG_PROXY_ERROR_LOG=/dev/stderr | |
- KONG_ADMIN_ERROR_LOG=/dev/stderr | |
- KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl | |
ports: | |
- "8000:8000" | |
- "8443:8443" | |
- "127.0.0.1:8001:8001" | |
- "127.0.0.1:8444:8444" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_format_version: "2.1" | |
services: | |
- name: demo-service | |
# change port and path to the configured in your application | |
url: http://host.docker.internal:8080/<path_from_application> | |
routes: | |
- name: demo-route | |
paths: | |
- /<path_name_to_kong> | |
# authentication service | |
plugins: | |
- name: key-auth | |
service: demo-service | |
config: | |
key_names: | |
- apikey | |
key_in_body: false | |
key_in_header: true | |
key_in_query: false | |
hide_credentials: false | |
run_on_preflight: true | |
consumers: | |
- username: user123 | |
keyauth_credentials: | |
- consumer: user123 | |
key: "kingkong" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dockerized Kong API Gateway
kong.yml
which cares the kong settings.