- REST API with a single endpoint running on FastAPI
- REST API should be served via Kong-OSS
- Authentication with JWT
- Rate Limited
- Konga Frontend for Kong-OSS
- Working installation
- Documentation
This project has 3 modular parts
- Docker containers
- LXC containers
- Nginx configuration
The docker-compose.yml file will add the following services:
- Kong-OSS
- FastAPI
- MySQL
- PostgreSQL
- Run
sudo docker-compose upto build and run the services - FastAPI will be available on
127.0.0.1:9090. Send a request using httpie or curlhttp '127.0.0.1:9090/reports?fname=สุภารัตน์'
Konga's docker image is outdated and wont run without fatal errors. The solution is build Konga from source and run it in a LXC container.
Ubuntu distros already have LXC installed. To confirm run sudo lxc --version the current version on Ubuntu 20.04 LTS is 4.0.8.
- Run
sudo lxc image list images:ubuntu | grep focal | grep container - Copy the hash for the 64bit container. Make sure you are not selecting a cloud or desktop container.
- Run
sudo lxc launch images:<focal-fossa-hash> konga - From the image the correct hash is f6734866c479. To start a LXC container the command becomes
sudo lxc launch images:f6734866c479 konga
Run sudo lxc exec konga -- /bin/bash
After logging into the container the next step will be to install dependencies.
- Run
sudo apt install postgresql git build-essential - Run
cd /opt && sudo git clone https://github.com/pantsel/konga.git sudo curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs
To complete the install follow the instructions at https://github.com/pantsel/konga#production
Extracted from the Konga github page
- Run migrations with
node ./bin/konga.js prepare --adapter postgres --uri postgresql://localhost:5432/konga $ npm run bower-deps$ npm run productionto start Konga- Konga should be avaliable at http://localhost:1337

