Volumes don't work with postgres on ACA. You should use a hosted database management system:
var builder = DistributedApplication.CreateBuilder(args);
var postgres = builder.AddAzurePostgresFlexibleServer("postgres")
.RunAsContainer();
var postgresdb = postgres.AddDatabase("postgresdb");
var exampleProject = builder.AddProject<Projects.ExampleProject>()
.WithReference(postgresdb);
For more information: https://learn.microsoft.com/en-us/dotnet/aspire/database/azure-postgresql-entity-framework-integration?tabs=dotnet-cli
Related issue in dotnet/aspire repo: https://learn.microsoft.com/en-us/dotnet/aspire/database/azure-postgresql-entity-framework-integration?tabs=dotnet-cli