-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added another Docker files as an example. These files are proposed in…
… PR #20. They include the generation of a PostgreSQL and Kong instance. They are included as an example and not as "official" King's docker support because I consider that King`s docker should only include the King UI deploy.
- Loading branch information
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# ignore .git and .cache folders | ||
.git | ||
.cache | ||
|
||
# ignore all markdown files (md) beside all README*.md other than | ||
# README-secret.md | ||
*.md | ||
|
||
# ignore docs folders | ||
docs/ | ||
|
||
# ignore Dockerfile and docker-compose files | ||
*Dockerfile* | ||
*docker-compose* | ||
|
||
# ignore node modules and logs | ||
node_modules/ | ||
npm-debug.log |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# King Build Image | ||
FROM node:19-alpine as dist | ||
|
||
WORKDIR /src | ||
|
||
COPY package*.json . | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
RUN npm run build-prod | ||
|
||
# King Nginx image | ||
FROM nginx:1.23.2-alpine as nginx | ||
|
||
COPY --from=dist /src/dist/king /usr/share/nginx/html |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### Docker | ||
|
||
You can try King for Kong using [docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/install/) with the next command. | ||
|
||
``` | ||
docker-compose up -d | ||
``` | ||
|
||
This will create a Kong Api Gateway container, a Postgresql container and finally a King for king container. After that King for Kong will be available at `http://localhost:8080` in production mode |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: '3' | ||
|
||
services: | ||
kong-database: | ||
image: postgres:15.1-alpine | ||
container_name: kong-database | ||
environment: | ||
- POSTGRES_USER=kong | ||
- POSTGRES_DB=kong | ||
- POSTGRES_PASSWORD=kong | ||
volumes: | ||
- "db-data-kong-postgres:/var/lib/postgresql/data" | ||
kong-migrations: | ||
image: kong:3.0.1-alpine | ||
environment: | ||
- KONG_DATABASE=postgres | ||
- KONG_PG_HOST=kong-database | ||
- KONG_PG_PASSWORD=kong | ||
command: kong migrations bootstrap | ||
restart: on-failure | ||
kong: | ||
image: kong:3.0.1-alpine | ||
container_name: kong | ||
environment: | ||
- KONG_PG_HOST=kong-database | ||
- KONG_PG_USER=kong | ||
- KONG_PG_PASSWORD=kong | ||
- 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_PROXY_LISTEN=0.0.0.0:8000 | ||
- KONG_PROXY_LISTEN_SSL=0.0.0.0:8443 | ||
- KONG_ADMIN_LISTEN=0.0.0.0:8001 | ||
- KONG_CUSTOM_PLUGINS=kong-plugin-moesif | ||
restart: on-failure | ||
ports: | ||
- 8000:8000 | ||
- 8443:8443 | ||
- 8001:8001 | ||
king: | ||
build: | ||
context: . | ||
container_name: king | ||
restart: on-failure | ||
ports: | ||
- 8080:80 | ||
|
||
volumes: | ||
db-data-kong-postgres: |