Pick your favorite distribution (Ubuntu, Debian, CentOS, Fedora, etc.) and use it as the base of your application.
- Compile the most recent release of Python from source code (you will need to install some prerequisites).
- Add a Python based application using MongoDB or PostgreSQL or MySQL - whatever you like.
- Prepare it for distribution.
- Install NodeJS, express, create a small web app (hello world would suffice) and prepare it for distribution.
- Create a system of two Flask (or Express) applications that provide APIs and a third command-line application that accesses those APIs.