Persistent Database
This topic provides steps to set up Elsa Server and Studio with a PostgreSQL database using Docker Compose. PostgreSQL is used as an example - other database engines are supported as well, including MySql and SQL Server.
Docker Compose Configuration
Below is the Docker Compose file used to set up Elsa with PostgreSQL:
Configuration Details
The Docker Compose file defines two services:
PostgreSQL Service: A PostgreSQL database container configured with the following settings:
User:
elsa
Password:
elsa
Database:
elsa
Max Connections:
2000
Elsa Server + Studio: A container running Elsa Server and Studio, configured to use PostgreSQL as the database provider.
Environment Variables: Defines
DATABASEPROVIDER
asPostgreSql
and the PostgreSQL connection string inCONNECTIONSTRINGS__POSTGRESQL
.Ports: Maps port
14000
on the host to8080
in the container.
Supported Database Providers
Elsa supports multiple database providers, which can be configured using the DATABASEPROVIDER
environment variable:
SqlServer
Sqlite
(default)MySql
PostgreSql
In this setup, PostgreSql
is used as the database provider.
Running the Services
To run the services defined in the Docker Compose file, use the following command:
Once the services are running, you can access Elsa Studio by navigating to http://localhost:14000.
Last updated