Self hosting Tereus
Tereus is open-source, which means you can host it yourself. The source code is available on Github.
Requirements
- Docker
- Docker Compose
- Git
- Node.js v16.x
Setting up the API and storage services
The API is written in Go, and is available on Github.
The docker-compose.yml
file inside the repo contains the following services:
api
: The API servicepostgres
: The PostgreSQL service for databaseminio
: The MinIO service for object storagensqd
: The NSQ service for queuing
Setting up the API with the services is done by running the following commands:
git clone git@github.com:tereus-project/tereus-api.git
cd tereus-api
cp env.example .env
docker-compose up -d
The docker-compose services, including the API, use environment variables to configure themselves. The .env.example
file contains the environment variables that you need to set for a local environment, but you can modify the file to your own needs.
The docker containers should look like this:
~/tereus/tereus-api ‹main› » docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------------------------------------------------------------------------------------
tereus-api_api_1 /go/bin/air Up 0.0.0.0:1323->1323/tcp
tereus-api_minio_1 /usr/bin/docker-entrypoint ... Up (healthy) 0.0.0.0:9000->9000/tcp, 0.0.0.0:9001->9001/tcp
tereus-api_nsqadmin_1 /nsqadmin --lookupd-http-a ... Up 4150/tcp, 4151/tcp, 4160/tcp, 4161/tcp, 4170/tcp, 0.0.0.0:4171->4171/tcp
tereus-api_nsqd_1 /nsqd --lookupd-tcp-addres ... Up 0.0.0.0:4150->4150/tcp, 0.0.0.0:4151->4151/tcp, 4160/tcp, 4161/tcp, 4170/tcp, 4171/tcp
tereus-api_nsqlookupd_1 /nsqlookupd Up 4150/tcp, 4151/tcp, 0.0.0.0:4160->4160/tcp, 0.0.0.0:4161->4161/tcp, 4170/tcp, 4171/tcp
tereus-api_postgres_1 docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp
Setting up the web interface
The web interface is written in React with Remix, and is available on Github.
You can setup the frontend by running the following commands:
git clone git@github.com:tereus-project/tereus-front.git
cd tereus-front
cp env.example .env
npm install
npm run dev
Setting up a transpiler
Tereus uses transpiler services to transpile the code. For example, we have a dedicated transpiler service for C-to-Go, which is available on Github
The transpiler uses the NSQ message queue to get the transpilation submissions and to return the status, so you will need to setup the API beforehand as it relies on the same Docker network.
You can run the transpiler with:
git clone git@github.com:tereus-project/tereus-transpiler-c-go.git
cd tereus-transpiler-c-go
cp env.example .env
docker-compose up -d