Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@ nbproject
/config/mssqlconfig.js
/www/
/seeds/
#
kongadata/
postgresdata/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,4 @@ nbproject
.env
/seeds/
/seeds/
/postgresdata/
16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
FROM node:12.16-alpine

COPY . /app

WORKDIR /app

RUN apk upgrade --update \
&& apk add bash git ca-certificates \
&& npm install -g bower \
&& npm --unsafe-perm --production install \
&& apk del git \
&& rm -rf /var/cache/apk/* \
/app/.git \
/app/screenshots \
/app/test \
&& adduser -H -S -g "Konga service owner" -D -u 1200 -s /sbin/nologin konga \
&& mkdir /app/kongadata /app/.tmp \
&& chown -R 1200:1200 /app/views /app/kongadata /app/.tmp
/app/test

EXPOSE 1337
COPY package.json package-lock.json ./

RUN npm install

VOLUME /app/kongadata
COPY . .

EXPOSE 1337

ENTRYPOINT ["/app/start.sh"]
93 changes: 34 additions & 59 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,44 @@
version: "3"

networks:
kong-net:
driver: bridge
version: "3.8"

services:

#######################################
# Postgres: The database used by Kong
#######################################
kong-database:
image: postgres:9.6
konga:
image: konga:latest
build: .
restart: always
networks:
- kong-net
environment:
POSTGRES_USER: kong
POSTGRES_DB: kong
POSTGRES_PASSWORD: kong
container_name: konga
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "kong"]
interval: 5s
timeout: 5s
retries: 5

#######################################
# Kong database migration
#######################################
kong-migration:
image: kong:1.5
command: "kong migrations bootstrap"
networks:
- kong-net
restart: on-failure
- 1337:1337
environment:
KONG_PG_HOST: kong-database
KONG_PG_PASSWORD: kong
links:
- kong-database
- NODE_ENV=development
- DB_ADAPTER=postgres
- DB_HOST=konga-database
- DB_PORT=5432
- DB_USER=konga
- DB_PASSWORD=password
- DB_DATABASE=konga
volumes:
- ./api/:/app/api/
logging:
driver: "json-file"
options:
max-size: 10m
max-file: "3"
depends_on:
- kong-database

#######################################
# Kong: The API Gateway
#######################################
kong:
image: kong:1.5
- konga-database
entrypoint: ["npm", "start"]
konga-database:
image: postgres:9.6
restart: always
networks:
- kong-net
environment:
KONG_PG_HOST: kong-database
KONG_PG_PASSWORD: kong
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
depends_on:
- kong-database
POSTGRES_USER: konga
POSTGRES_PASSWORD: password
POSTGRES_DB: konga
volumes:
- ./postgresdata:/var/lib/postgresql/data
ports:
- 5433:5432
healthcheck:
test: ["CMD", "curl", "-f", "http://kong:8001"]
test: ["CMD", "pg_isready", "-U", "konga"]
interval: 5s
timeout: 2s
retries: 15
ports:
- 8001:8001
- 8000:8000
timeout: 5s
retries: 5