Created
March 12, 2018 12:34
-
-
Save bboyle1234/4ed79eae38b82b8519958cf26fc87f5f to your computer and use it in GitHub Desktop.
Example MongoDB connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static ISiloHost CreateSilo() { | |
var builder = new SiloHostBuilder() | |
.Configure(options => options.ClusterId = NDGConfig.ClusterId) | |
.Configure<ProcessExitHandlingOptions>(options => options.FastKillOnProcessExit = false) | |
.ConfigureSiloName(NDGConfig.ClusterId + "-" + NDGConfig.SiloHostName) | |
.ConfigureEndpoints(advertisedIP: NDGConfig.SiloIP, siloPort: NDGConfig.SiloPort, gatewayPort: NDGConfig.GatewayPort, listenOnAllHostAddresses: true) | |
.ConfigureLogging(b => b.SetMinimumLevel(LogLevel.Error).AddConsole()) | |
.UseDashboard(options => { | |
options.Port = NDGConfig.SiloDashboardPort; | |
options.Username = NDGConfig.SiloDashboardUsername; | |
options.Password = NDGConfig.SiloDashboardPassword; | |
}) | |
.UseMongoDBReminders(options => { | |
options.ConnectionString = NDGConfig.MongoDBConnectionString; | |
options.DatabaseName = NDGConfig.ClusterId + "-Reminders"; | |
}) | |
.UseMongoDBClustering(options => { | |
options.ConnectionString = NDGConfig.MongoDBConnectionString; | |
options.DatabaseName = NDGConfig.ClusterId + "-Clustering"; | |
}); | |
MongoDBSiloExtensions.AddMongoDBGrainStorageAsDefault(builder, options => { | |
options.ConnectionString = NDGConfig.MongoDBConnectionString; | |
options.DatabaseName = NDGConfig.ClusterId + "-Storage"; | |
}); | |
MongoDBSiloExtensions.AddMongoDBGrainStorage(builder, "PubSubStore", options => { | |
options.ConnectionString = NDGConfig.MongoDBConnectionString; | |
options.DatabaseName = NDGConfig.ClusterId + "-PubSubStorage"; | |
}); | |
return builder.Build(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
mysilo: | |
image: mysilo | |
links: | |
- mongo | |
depends_on: | |
- mongo | |
build: | |
context: . | |
dockerfile: MySilo/Dockerfile | |
environment: | |
- MONGODB_CONNECTION_STRING=mongodb://mongo:27017 | |
mongo-express: | |
image: mongo-express | |
hostname: mongo-express | |
depends_on: | |
- mongo | |
links: | |
- mongo | |
ports: | |
- 8081:8081 | |
mongo: | |
image: mongo | |
hostname: mongo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment