chore(discord): add healthcheck to compose.yaml discord service
Issue #32
This commit is contained in:
@@ -77,6 +77,11 @@ services:
|
|||||||
- "Discord__Token=${DISCORD_BOT_TOKEN:?Set DISCORD_BOT_TOKEN in .env}"
|
- "Discord__Token=${DISCORD_BOT_TOKEN:?Set DISCORD_BOT_TOKEN in .env}"
|
||||||
networks:
|
networks:
|
||||||
- gmrelay
|
- gmrelay
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "wget -qO- http://localhost:8082/health || exit 1"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: git.codeanddice.ru/toutsu/gmrelay-web:2.7.0
|
image: git.codeanddice.ru/toutsu/gmrelay-web:2.7.0
|
||||||
|
|||||||
@@ -93,4 +93,21 @@ public sealed class DiscordProjectStructureTests
|
|||||||
|
|
||||||
Assert.Contains("DISCORD_BOT_TOKEN", envExample);
|
Assert.Contains("DISCORD_BOT_TOKEN", envExample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Compose_ShouldIncludeDiscordHealthcheck()
|
||||||
|
{
|
||||||
|
var repoRoot = GetRepoRoot();
|
||||||
|
var compose = File.ReadAllText(Path.Combine(repoRoot, "compose.yaml"));
|
||||||
|
|
||||||
|
var discordIndex = compose.IndexOf("discord:", StringComparison.Ordinal);
|
||||||
|
Assert.True(discordIndex >= 0, "compose.yaml should contain discord service");
|
||||||
|
|
||||||
|
var nextServiceIndex = compose.IndexOf(" web:", StringComparison.Ordinal);
|
||||||
|
var discordBlock = compose[discordIndex..nextServiceIndex];
|
||||||
|
|
||||||
|
Assert.Contains("healthcheck:", discordBlock);
|
||||||
|
Assert.Contains("test:", discordBlock);
|
||||||
|
Assert.Contains("localhost:8082/health", discordBlock);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user