Skip to content

Deployment

Docker deployments are the only way to get starting with TypeScheduler for now. The basis for this tutorial is the starter template available on github. starter-template. This is the best way to start with the project as well as this documentation as reference.

TypeScheduler needs some more services to fully work, even though only the 2 main containers (backend & frontend) are required. here is the list of all the services:

  • Main backend: The scheduler backend, this is based on ghcr.io/moda20/type_scheduler_backend:latest image
  • Main frontend: The scheduler frontend, this is based on ghcr.io/moda20/type_scheduler_ui:latest image
  • Database service: MySQL database or something compatible like mariadb
  • Gotify service (Optional): This is still the default notification service for job events, but you can still disable it and/or use a custom notification service.
  • Ntfy service (Optional): Another notification service, it’s added to teh system by default and can only be used after the configuration is set.
  • Grafana Loki service (Optional): This is the main logging service and is used to save most logs including job and instance logs and without it you won’t be able to read single task run logs. it is optional

The best way to deploy the entire stack is using the example compose.yml. it also requires some env variables in order to launch properly. The mandatory env variables are the following (from .env.example)

# Mandatory Env variable
# See /configuration#generating-the-master_encryption_key for how to generate this key
MASTER_ENCRYPTION_KEY=
# Databases
DB_HOST=mysql
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=root
SCHEDULER_DB_NAME=scheduler_db
BASE_DB_HOST=mysql
BASE_DB_NAME=scheduler_base
BASE_DB_USERNAME=root
BASE_DB_PASSWORD=root
BASE_DB_PORT=3306

More on these variables can be found on this documentation page or on Github

The next step is to get the types needed to have a good coding experience with your tasks. Todo so run the following scp command to copy them from the backend image

docker create --name=scc_b ghcr.io/moda20/type_scheduler_backend:latest && docker cp scc_b:/usr/src/app/extraTypes/types.d.ts ./types.d.ts && docker container rm scc_b

There are 2 docker comose files :

  • compose.yml this file uses 2 separate containers one for the frontend and one for the backend, this is the default way of running TypeScheduler. This helps to keep track of the latest features, or when developing/contributing to the project or when trying different images

  • compose.merged.yml This compose file combines the frontend and backend into the app container and still requires at least the mysql service to run properly. this is useful for stable versions. this also allows to choose the branches to use for both base repos but this will require running the build locally.

Running both files is the same and uses the standard compose up commands :

docker-compose up -d