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
  • Setup Instructions
  • Environment Configuration
  • Troubleshooting
Edit on GitHub
  1. Getting Started
  2. Containers
  3. Docker Compose

Traefik

This guide walks you through setting up and running Elsa Server and Studio using a Docker Compose file. The setup includes PostgreSQL as the database, Traefik as a reverse proxy, and Elsa workflows.

Docker Compose Configuration

The following docker-compose.yml file defines services for:

  • PostgreSQL database for data persistence.

  • Elsa Server and Studio, configured to use PostgreSQL.

  • Traefik reverse proxy for routing requests to the appropriate service.

services:

    # PostgreSQL database.
    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"
        networks:
            - elsa-network

    # Elsa Server and Studio behind Traefik and configured with PostgreSQL.
    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
            HOSTING__BASEURL: http://elsa.localhost:1280
            DATABASEPROVIDER: PostgreSql
            CONNECTIONSTRINGS__POSTGRESQL: Host=postgres;Port=5432;Database=elsa;Username=elsa;Password=elsa
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.elsa.rule=Host(`elsa.localhost`)"
            - "traefik.http.services.elsa.loadbalancer.server.port=8080"
        networks:
            - elsa-network

    # Traefik reverse proxy.
    traefik:
        image: traefik:2.7.2
        command:
            - "--api.insecure=true" # Enables the Traefik dashboard
            - "--providers.docker=true" # Enables Docker as the configuration source
            - "--entrypoints.web.address=:80" # Sets up the HTTP entry point on port 80
        ports:
            - "1280:80" # Expose HTTP port. Access Elsa Studio at: http://elsa.localhost:1280/
            - "8080:8080" # Expose Traefik dashboard
        volumes:
            - "/var/run/docker.sock:/var/run/docker.sock" # Allows Traefik to communicate with the Docker daemon
        networks:
            - elsa-network
        depends_on:
            - elsa-server-and-studio

networks:
    elsa-network:
        driver: bridge

volumes:
    postgres-data:

Setup Instructions

Follow these steps to set up and run the Docker Compose configuration:

  • Create a file named docker-compose.yml and paste the provided configuration into it.

  • Run the following command in the directory containing the docker-compose.yml file to start the services:

    docker-compose up
  • Edit your /etc/hosts file (on Linux/Mac) or C:\Windows\System32\drivers\etc\hosts (on Windows) to include the following entry for mapping elsa.localhost to 127.0.0.1:

    127.0.0.1 elsa.localhost
  • Once the services are running:

Environment Configuration

The environment variables and settings used in this Docker Compose file:

  • PostgreSQL: The database user, password, and name are configured as elsa.

  • Elsa Server and Studio: Configured to use PostgreSQL as the database provider.

  • Traefik: Acts as a reverse proxy with routing rules for elsa.localhost.

Troubleshooting

If you encounter issues, check the following:

  • Ensure Docker and Docker Compose are correctly installed and running.

  • Verify the /etc/hosts file includes an entry for elsa.localhost mapping to 127.0.0.1.

  • Inspect logs for each service using docker-compose logs [service-name].

PreviousPersistent DatabaseNextElsa Server

Last updated 1 month ago

Ensure you have Docker and Docker Compose installed on your machine. Refer to the if necessary.

Access Elsa Studio at .

Open the Traefik dashboard at .

prerequisites
http://elsa.localhost:1280
http://localhost:8080