Skip to content

Getting Started

The quickest way to get started is to install Docker.

We then need a specific folder, e.g. c:\development.docker\pigeon, in which we can then create a docker-compose.yml file that contains the following content:

services:
    azurite:
        image: mcr.microsoft.com/azure-storage/azurite
        hostname: azurite
    database:
        image: shuttle/pigeon-sqlserver-linux:latest
        hostname: database
        ports:
            - "2433:1433"
    server:
        image:
            shuttle/pigeon-server:latest
        environment:
            - CONFIGURATION_FOLDER=.
        depends_on:
            - "azurite"
            - "database"
        volumes:
            - type: bind
              source: ./server-appsettings.json
              target: /opt/shuttle.pigeon.server/appsettings.json
    web-api:
        image:
            shuttle/pigeon-webapi:latest
        environment:
            - ASPNETCORE_URLS=http://*:5268
            - CONFIGURATION_FOLDER=.
        depends_on:
            - "azurite"
            - "server"
        ports:
            - "5269:5268"
        volumes:
            - type: bind
              source: ./webapi-appsettings.json
              target: /opt/shuttle.pigeon.webapi/appsettings.json

You will also notice some bindings to the following files:-

First, we need server-appsettings.json file:

json
{
  "Serilog": {
    "Using": [
      "Serilog.Sinks.Console",
      "Serilog.Sinks.File"
    ],
    "MinimumLevel": {
      "Default": "Debug",
      "Override": {
        "System.Net.Http": "Error"
      }
    },
    "WriteTo": [
      {
        "Name": "Console"
      },
      {
        "Name": "File",
        "Args": {
          "path": "./logs/.log",
          "rollOnFileSizeLimit": true,
          "retainedFileCountLimit": 30,
          "fileSizeLimitBytes": 1048576,
          "rollingInterval": "Day"
        }
      }
    ]
  },
  "ConnectionStrings": {
    "Pigeon": "server=database;database=Pigeon;user id=sa;password=Pass!000;TrustServerCertificate=true",
    "azure": "UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://azurite"
  },
  "Shuttle": {
    "Pigeon": {
      "Postmark": {
        "ServerToken": ""
      },
      "SendGrid": {
        "ApiKey": ""
      },
      "MailKit": {
        "Host": "mail.example.com",
        "Username": "noreply@example.com",
        "Password": "",
        "SenderAddress": "noreply@ebenroux.co.za",
        "SenderDisplayName": "(no-reply)"
      },
      "ChannelDefaultMessageSenders": [
        {
          "Channel": "email",
          "Name": "mailkit"
        }
      ]
    },
    "ServiceBus": {
      "Inbox": {
        "WorkQueueUri": "azuresq://azure/pigeon-server-inbox-work",
        "DeferredQueueUri": "azuresq://azure/pigeon-server-inbox-deferred",
        "ErrorQueueUri": "azuresq://azure/pigeon-error",
        "MaximumFailureCount": 8,
        "ThreadCount": 1,
        "DurationToIgnoreOnFailure": [
          "00:00:01",
          "00:00:01",
          "00:00:01",
          "00:00:01",
          "00:00:01",
          "00:00:05",
          "00:00:10",
          "00:00:30"
        ]
      }
    }
  }
}

You will need to remove the Shuttle:Pigeon:{sender} configuration sections that you will not be using, and populate the relevant details on the active one(s).

And we also need a webapi-appsettings.json file:

json
{
  "Serilog": {
    "Using": ["Serilog.Sinks.Console", "Serilog.Sinks.File"],
    "MinimumLevel": {
      "Default": "Debug",
      "Override": {
        "System.Net.Http": "Error"
      }
    },
    "WriteTo": [
      {
        "Name": "Console"
      },
      {
        "Name": "File",
        "Args": {
          "path": "./logs/.log",
          "rollOnFileSizeLimit": true,
          "retainedFileCountLimit": 30,
          "fileSizeLimitBytes": 1048576,
          "rollingInterval": "Day"
        }
      }
    ]
  },
  "ConnectionStrings": {
    "azure": "UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://azurite",
    "Access": "Data Source=database;Initial Catalog=Pigeon;user id=sa;password=Pass!000;TrustServerCertificate=true"
  },
  "Shuttle": {
    "Access": {
      "Client": {
        "BaseAddress": "http://localhost:5599"
      }
    },
    "ServiceBus": {
      "MessageRoutes": [
        {
          "Uri": "azuresq://azure/pigeon-server-inbox-work",
          "Specifications": [
            {
              "Name": "StartsWith",
              "Value": "Shuttle.Pigeon.Messages"
            }
          ]
        }
      ]
    }
  }
}

You will now be able to run docker-compose up in the folder containing the above file:

> docker-compose up

To view the web-api endpoints you can browse to the swagger page:

http://localhost:5268/swagger/index.html