Skip to content

Additional customization for docker-compose publisher for service source #9744

@MarioGK

Description

@MarioGK

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

It would be great if we could configure the docker service source if it is an "image" or a "build".

Describe the solution you'd like

Maybe in the AppHost we could have an overload for the WithComputeEnvironment to have an options so we could customize the current resource in that environment.
Example:

.WithComputeEnvironment(compose, options =>
                    {
                        options.ImageName = "test";
                        // Prefer Build.XXX if not null, otherwise use the options.ImageName otherwise use the current name.
                        options.Build.Context = ".";
                        options.Build.Dockerfile = "Dockerfile";
                        // or
                        options.BuildContext = ".";
                        options.BuildDockerfile = "Dockerfile";
                    })

So instead of:

  webapp:
    image: "${WEBAPP_IMAGE}"

We would have:

  webapp:
    build:
      context: .
      dockerfile: ./WebApp//Dockerfile

In the final docker-compose.yaml, this would facilitate having deployment per PR for example or just do a quick and dirty test on another environment.

This would enable easy deploy in Dokploy, Coolify and similar easy self hosted services.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions