Skip to content

Add support for pushing files into go containers #977

Description

@tommasodotNET

Related to an existing integration?

Yes

Existing integration

Golang

Overview

We want to add support to golang container for pushing files into the container, as Aspire does for resources such as NodeApp or PythonApp:
https://github.com/dotnet/aspire/blob/081b614a331e3c8eb051304712f9c26aecb7e395/src/Aspire.Hosting.Python/PythonAppResource.cs#L63.

We should only to implement the interface IContainerFilesDestinationResource and handle the container files: https://github.com/dotnet/aspire/blob/9c0a92bb2d0fa509e871e5a70a21ad495db46c82/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs#L167.

We might want to update the golang sample to actually have a static frontend to show how to push those file in the golang container.

Usage example

var golang = builder.AddGolangApp("golang", "../gin-api")
    .WithHttpEndpoint(env: "PORT")
    .WithHttpHealthCheck("/health");

var frontend = builder.AddViteApp("frontend", "./frontend")
    .WithReference(golang)
    .WaitFor(golang);

golang.PublishWithContainerFiles(frontend, "./static");

Breaking change?

No

Alternatives

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions