LogoLogo
GitHub
  • Elsa Workflows 3
  • Getting Started
    • Concepts
      • Outcomes
      • Correlation ID
    • Hello World
    • Prerequisites
    • Packages
    • Containers
      • Docker
      • Docker Compose
        • Elsa Server + Studio
        • Elsa Server + Studio - Single Image
        • Persistent Database
        • Traefik
  • Application Types
    • Elsa Server
    • Elsa Studio
    • Elsa Server + Studio (WASM)
  • Guides
    • HTTP Workflows
      • Programmatic
      • Designer
    • External Application Interaction
    • Loading Workflows from JSON
    • Running Workflows
      • Using Elsa Studio
      • Using a Trigger
      • Dispatch Workflow Activity
  • Activities
    • Control Flow
      • Decision
    • MassTransit
      • Tutorial
  • Expressions
    • C#
    • JavaScript
    • Python
    • Liquid
  • Extensibility
    • Custom Activities
  • Reusable Triggers (3.5-preview)
  • Multitenancy
    • Introduction
    • Setup
  • Operate
    • Variables
    • Activation Strategies
    • Incidents
      • Strategies
      • Configuration
    • Alterations
      • Alteration Plans
        • REST API
      • Applying Alterations
        • REST API
        • Extensibility
  • Optimize
    • Log Persistence
    • Retention
  • Hosting
    • Distributed Hosting
Powered by GitBook
On this page
  • Docker Compose Configuration
  • Configuration Details
  • Supported Database Providers
  • Running the Services
Edit on GitHub
  1. Getting Started
  2. Containers
  3. Docker Compose

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:

services:

    postgres:
        image: postgres:latest
        command: -c 'max_connections=2000'
        environment:
            POSTGRES_USER: elsa
            POSTGRES_PASSWORD: elsa
            POSTGRES_DB: elsa
        volumes:
            - postgres-data:/var/lib/postgresql/data
        ports:
            - "5432:5432"

    elsa-server-and-studio:
        image: elsaworkflows/elsa-server-and-studio-v3-4-0-preview:latest
        pull_policy: always
        environment:
            ASPNETCORE_ENVIRONMENT: Development
            HTTP_PORTS: 8080
            HTTP__BASEURL: http://localhost:14000
            DATABASEPROVIDER: PostgreSql
            CONNECTIONSTRINGS__POSTGRESQL: Server=postgres;Username=elsa;Database=elsa;Port=5432;Password=elsa;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60
        ports:
            - "14000:8080"
        depends_on:
            - postgres

volumes:
    postgres-data:

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 as PostgreSql and the PostgreSQL connection string in CONNECTIONSTRINGS__POSTGRESQL.

    • Ports: Maps port 14000 on the host to 8080 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:

docker-compose up
PreviousElsa Server + Studio - Single ImageNextTraefik

Last updated 1 month ago

Once the services are running, you can access Elsa Studio by navigating to .

http://localhost:14000