csharpfritz / csharpfritz/AspireAntivirus
When Published, ClamAV has Minimum RAM Requirements
- Dominant language
- C#
- Stars
- 20
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
See documentation here: [https://docs.clamav.net/manual/Installing/Docker.html](https://docs.clamav.net/manual/Installing/Docker.html)
**Code below is for .NET 10 and Aspire 13.1.0.**
Suggest adding `Aspire.Hosting.Azure.AppContainers` nuget package to the AppHopst project, and then updating the ClamAV.cs file as follows:
```CSharp
return builder.AddResource(resource)
.WithImage("clamav/clamav")
.WithImageRegistry("docker.io")
.WithImageTag("latest")
.WithEnvironment("CLAMAV_NO_FRESHCLAMD", builder.ExecutionContext.IsRunMode.ToString())
.WithEndpoint(port: port, name: ClamAvResource.PrimaryEndpointName, targetPort: 3310)
.PublishAsAzureContainerApp((module, app) =>
{
app.Template.Scale.MinReplicas = 1;
app.Template.Scale.MaxReplicas = 10;
var c = app.Template?.Containers?.FirstOrDefault()?.Value;
if (c != null)
{
c.Resources.Cpu = 2.0; // 2 vCPUs
c.Resources.Memory = "4Gi"; // 4 GiB RAM (needs 2 vCPUs)
}
});
```
Adjust the Min/Max replicas to taste. You will also need to add the following line to your AppHost.cs if it is not there already:
```CSharp
// IMPORTANT - keep the ACA name as short as possible to avoid resource name clashes
// when the Data Volume is deployed!
var acaEnv = builder.AddAzureContainerAppEnvironment("aca");
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with ClamAV.cs and AppHost.cs, then read the linked ClamAV Docker documentation and the Aspire.Hosting.Azure.AppContainers API. Done means the Azure Container Apps deployment is configured with the requested environment, replica settings, and minimum 2 vCPU/4 GiB resources, while local execution remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, docker
- Domain
- cloud, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100