-
Notifications
You must be signed in to change notification settings - Fork 1
Docker Compose file example
Here's an example of a Docker Compose file for Fleet Manager. 🐳
It assumes that it has access to external MongoDB on mongodb://your-mongo-host
and external Kafka on tcp://your-kafka-host
, but these connections may be set to other types of connection strings to use other types of persistence, and the configured types of persistence may of course also be included as services in the file as well, if you like.
⚠ A NOTE ON BASE IMAGES: Since version 4.80.1 the Fleet Manager image has been based on a chiseled image from Microsoft, which drastically reduces the attack surface. It also means that the Fleet Manager hosting process will be running as UID 1654, which is the reason why the init_fleetmanager
service is necessary – it'll simply run as a preburner to ensure that the user with UID 1654 has the necessary access rights to the relevant volumes. Please adapt as required for your particular needs.
services:
init_fleetmanager:
image: "ubuntu"
restart: "no"
user: "root"
entrypoint: ["/bin/sh", "-c"]
command: ["chown -R 1654:1654 /usr/share/servicebus && chown -R 1654:1654 /usr/share/events"]
volumes:
- servicebus_directory:/data/servicebus
- events_directory:/data/events
fleetmanager:
image: "mookid8000/fleetmanager:4.80.1"
depends_on:
- init_fleetmanager
restart: "unless-stopped"
ports:
- "5000:5000"
volumes:
- servicebus_directory:/usr/share/servicebus
- events_directory:/usr/share/events
logging:
driver: "json-file"
options:
max-size: "50m"
environment:
# Listen URL - should correspond to mapped port above
FM_APPSETTINGS__LISTENURL: "http://+:5000"
# Add license details here
FM_APPSETTINGS__LICENSE__DOCUMENT__ID: "473897a34bb2233de3f56cb53e6ab563"
FM_APPSETTINGS__LICENSE__DOCUMENT__ISSUEDON: "20220907"
FM_APPSETTINGS__LICENSE__DOCUMENT__LICENSEE__NAME: "Your Company Name"
FM_APPSETTINGS__LICENSE__DOCUMENT__LICENSEE__VAT: "XX33478473.43874"
FM_APPSETTINGS__LICENSE__SIGNATURE: "gjg48gj434j7j49j7g8j678954j7grjig498484u5f=="
# Configuration
## Master key which will be used to generate all kinds of tokens - keep secret!
FM_APPSETTINGS__MASTERKEY: "GHUGEIWhukgeusgelksGHUKELHGKELSHUKLgehsuklgesHGUKELHUKGLEWghueghkelw="
## Configures the URL Fleet Manager should advertise to the outside world
FM_APPSETTINGS__URL: "http://localhostname:5000"
## Configures the API URL Fleet Manager should advertise to the outside world (i.e. the)
FM_APPSETTINGS__APIURL: "http://localhostname:5000/api"
## Configures events database - can be hostname+port (Kafka assumed) or a local directory (embedded events db)
FM_CONNECTIONSTRINGS__EVENTS: "/usr/share/events"
## Configures other types of storage - master data (can be MongoDB or SQL Server)
FM_CONNECTIONSTRINGS__MASTER: "mongodb://your-mongo-host:27017/fm-prod-master?maxIdleTimeMS=60000&maxPoolSize=1000"
## Primary projections (can be MongoDB or local directory)
FM_CONNECTIONSTRINGS__VIEWS: "mongodb://your-mongo-host:27017/fm-prod-views?maxIdleTimeMS=60000&maxPoolSize=1000"
## Secondary projections (can be Azure Storage, directory path, MongoDB, or Amazon S3)
FM_CONNECTIONSTRINGS__VIEWBLOBS: "mongodb://your-mongo-host:27017/fm-prod-blobs?maxIdleTimeMS=60000&maxPoolSize=100"
## Commands from FM to Rebus instances (can be MongoDB, SQL Server, or local directory)
FM_CONNECTIONSTRINGS__COMMANDS: "mongodb://your-mongo-host:27017/fm-prod-commands?maxIdleTimeMS=60000&maxPoolSize=500"
## Data bus (can be Azure Storage, directory path, MongoDB, or Amazon S3)
FM_CONNECTIONSTRINGS__DATABUS: "mongodb://your-mongo-host:27017/fm-prod-blobs?maxIdleTimeMS=60000&maxPoolSize=100"
## Message bus (can be Azure Service Bus, Amazon SQS, or directory path)
FM_CONNECTIONSTRINGS__SERVICEBUS: "/usr/share/servicebus"
## Configures the topic to use for event streaming (mostly relevant if the 'events' connection string is Kafka)
FM_APPSETTINGS__KAFKATOPIC: "fm-events-1"
## Override PRODUCER (not consumer) topic - can be used to migrate to a new topic, e.g. when changing number of partitions
#FM_APPSETTINGS__KAFKATOPICPRODUCEROVERRIDE: "fm-events-1"
## Defines how often the view blobs repository should be crawled for expired blobs
FM_APPSETTINGS__CLEANUPEXPIREDVIEWBLOBSINTERVAL: "01:00:00"
## Set to a valid email address to send ERROR logs to an email address
FM_APPSETTINGS__LOGERRORMAILS: ""
## Set to a valid file path pattern (e.g. /var/logs/fm/log.txt) to write logs to rolling files
FM_APPSETTINGS__LOGPATH: ""
## Configure SMTP settings to FM can send emails (or set the host to a local email pickup directory)
FM_APPSETTINGS__SMTP__HOST: "your.smtp.server.com"
FM_APPSETTINGS__SMTP__PORT: "587"
FM_APPSETTINGS__SMTP__USER: "some-user-name"
FM_APPSETTINGS__SMTP__PASS: "your-smtp-password"
volumes:
servicebus_directory:
events_directory:
If you happen to get a System.UnauthorizedAccessException
when starting up Fleet Manager, it's might be because you have upgraded from version 4.76.0 or an earlier version of Fleet Manager to 4.80.2 or later. The exception might look like this:
System.AggregateException: Could not verify write access to directory /data/events after 10 attempts (Access to the path '/data/events/.topos-test-file' is denied.) (Access to the path '/data/events/.topos-test-file' is denied.) (Access to the path '/data/events/.topos-test-file' is denied.) (Access to the path '/data/events/.topos-test-file' is denied.) (Access to the path '/data/events/.topos-test-file' is denied.) (Access to the path '/data/events/.topos-test-file' is denied.) (Access to the path '/data/events/.topos-test-file' is denied.) (Access to the path '/data/events/.topos-test-file' is denied.) (Access to the path '/data/events/.topos-test-file' is denied.) (Access to the path '/data/events/.topos-test-file' is denied.)
---> System.UnauthorizedAccessException: Access to the path '/data/events/.topos-test-file' is denied.
mongodb-1 | {"t":{"$date":"2024-07-18T11:40:36.392+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn2","msg":"Connection ended","attr":{"remote":"172.19.0.4:53396","uuid":"dfa2d59a-5f8e-44c5-af1a-6c3b74841b9d","connectionId":2,"connectionCount":1}}
---> System.IO.IOException: Permission denied
mongodb-1 | {"t":{"$date":"2024-07-18T11:40:36.392+00:00"},"s":"I", "c":"-", "id":20883, "ctx":"conn1","msg":"Interrupted operation as its client disconnected","attr":{"opId":17}}
--- End of inner exception stack trace ---
mongodb-1 | {"t":{"$date":"2024-07-18T11:40:36.392+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn3","msg":"Connection ended","attr":{"remote":"172.19.0.4:53410","uuid":"a5965ed8-536c-4b27-8e29-87bdef5801e9","connectionId":3,"connectionCount":2}}
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
mongodb-1 | {"t":{"$date":"2024-07-18T11:40:36.392+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn1","msg":"Connection ended","attr":{"remote":"172.19.0.4:53384","uuid":"25c70262-c628-4c54-91d1-cfa551f27475","connectionId":1,"connectionCount":0}}
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
at Topos.Config.FasterLogConfigurationExtensions.<CheckDirectoryPath>g__VerifyWritability|6_1(<>c__DisplayClass6_0&)
(...)
Please read the section about adapting for user with UID 1654 above and consule the Docker Compose example.
In case you think something is missing on the documentation wiki, please feel free to raise an issue and let us know: Click here to raise an issue
Overview
Areas
- Connecting Rebus Instances
- Configuring the Fleet Manager Plugin
- Failed Messages
- Delayed Messages
- Message Auditing
- Alerts
- Notification Groups
- Integrations
- Data
- Authentication
- External API
Self-hosted (on-premise/Docker)