Deploy using Docker Compose
Introduction
Currently, we support the use of Docker Compose to deploy the Syntho Application. We've included a Docker Compose file that will deploy all the containers necessary for the Syntho Application. The following page will outline the steps to undertake to deploy our application using Docker Compose.
Deployment steps
Download the latest Docker Compose files from our Github repository.
Use
docker login
to log into the Syntho Container Registry, ordocker load
to load images from files. See Syntho Documentation underDeploy Syntho
->Introduction
->Access Docker images
Copy over
example.env
to.env
using for example the Linux commandcp example.env .env
Adjust the following variables in
.env
for a minimal setup:LICENSE_KEY
: The license key is provided by Syntho.ADMIN_USERNAME
,ADMIN_EMAIL
andADMIN_PASSWORD
: the credentials for the admin account that can be used once the application is set up. The email and password will be needed to log in.
The .env
file contains the latest image tag for all images, which is a rolling tag. Please adjust the following image tags with the tags provided by the Syntho Team to pin them to a certain version:
RAY_IMAGE
CORE_IMAGE
BACKEND_IMAGE
FRONTEND_IMAGE
To access the Backend API correctly, the domain should be set. If the application is being accessed on the same machine that deploys it, localhost
should be fine for this domain. If you're using a different machine on your network, the IP address or hostname should be used for the following variables:
FRONTEND_HOST
: this should include the port as well. If port 3000 is used for the frontend, and it can be accessed on the same machine, the value would belocalhost:3000
. If another machine on the same network needs to access the frontend, the value will be<IP-of-deployed-machine>:3000
FRONTEND_DOMAIN
: will be eitherlocalhost
or the IP of the machine running the Syntho Application. Do not add the port on which the application is running if that's relevant.
After the adjustment of these variables, the docker compose
file should be ready for deployment. The documentation will continue to describe particular sections to adjust in particular cases, but at this point the Docker Compose file should be ready to deploy.
Additional information
Setting up multiple nodes requires a more detailed configuration. This setup is recommended for scalable production environments. Steps and configurations may vary depending on the specific requirements of the network and the number of nodes involved.
TLS
If an SSL certificate needs to be provided, the following environment variables need to be adjusted:
By default, these values are respectively set to http
and False
. Supplying a TLS certificate will need to be done via a separate application (like a reverse proxy such as NGINX, or cert-manager).
Core API
Database
The credentials for the database that the Core API & Worker (core
and core_worker
and in the docker-compose file) use to connect are described in the following environment variables:
By default, these values are set to the value for the Postgres instance that is being deployed as part of the docker-compose file. If another database needs to be used, the credentials can be adjusted here. Only Postgres databases are supported for this.
Redis
The information that is being used to connect to the Redis instance is saved in the following environment variables:
Additional environment variables
Important other variables are CORE_SECRET_KEY
, which is used as an encryption key. This key can be generated using the following command using python:
If issues with the port of the application arise, the default port can be changed using the CORE_PORT
variable in the .env
file.
Backend
Database
Just as the Core API, the backend will need to connect to the Postgres database. This database is used for storing application data. By default, this will connect
Redis
For the Redis instance used for the backend, we can set the following variables. The Redis instance is included in the docker-compose
file, but if a separate Redis instance is used, the credentials need to be set in the .env
file.
Admin user
As described earlier in the documentation, the username, email-address and password of the admin user can be adjusted. The following environment variables can be used for that:
Additional environment variables
For the backend, some additional environment variables can be set. We can change the port which is exposed for the backend if any issues arise with port mappings. To change the port, we can change the value in BACKEND_PORT
:
We then have the secret key that the backend uses for encryption purposes. We can set this key to any value, as long as it is a rather long string. Example:
Frontend
The frontend is responsible for the user interface. The frontend will need to connect to the Backend for this. The most important variable that is left for the frontend is the following:
This variable sets the port for the frontend, which will need to be exposed for the user to be able to access the application.
Last updated