Skip to content

davidfowl/aspire-ssh-deploy

Repository files navigation

Aspire Docker SSH Deployment Pipeline

feedz.io

Deploy Aspire applications to remote Docker hosts via SSH.

Overview

This package extends Aspire's Docker Compose support with a deployment pipeline that builds container images locally, pushes them to a registry, and deploys to a remote server via SSH. The pipeline handles SSH connection management, file transfers, and container orchestration with docker compose.

flowchart LR
    A[Dev Machine / CI<br/>aspire deploy] -->|SSH| B[Target Server<br/>docker compose up]
Loading

Quick Start

  1. Add the package feed:
dotnet nuget add source https://f.feedz.io/davidfowl/aspire/nuget/index.json --name davidfowl-aspire
  1. Install the package:
aspire add docker-sshdeploy

Or with the .NET CLI:

dotnet add package Aspire.Hosting.Docker.SshDeploy --prerelease
  1. Add SSH deployment support to your AppHost:
builder.AddDockerComposeEnvironment("env")
    .WithSshDeploySupport();
  1. Deploy:
aspire deploy

The pipeline will prompt for SSH credentials, registry configuration, and deploy path.

Documentation

See the package README for:

  • Configuration options (appsettings.json, environment variables)
  • SSH authentication (key-based vs password)
  • Target host privacy settings

Sample Project

See samples/DockerPipelinesSample for a complete example:

aspire run     # Run locally
aspire deploy  # Deploy to remote host

CI/CD with GitHub Actions

See .github/workflows/deploy.yml for a complete example using GitHub Container Registry with secrets for SSH credentials.

About

An extension of the docker compose integration for deploying to a docker host via SSH

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages