{"id":50809749,"url":"https://github.com/funsjanssen/aspire-coolify-starter","last_synced_at":"2026-06-13T03:34:40.355Z","repository":{"id":349014637,"uuid":"1200729011","full_name":"funsjanssen/aspire-coolify-starter","owner":"funsjanssen","description":"Minimal .NET Aspire starter with Blazor, a sample API, Docker Compose-friendly AppHost, and GitHub Actions that push to GHCR and trigger Coolify.","archived":false,"fork":false,"pushed_at":"2026-04-03T19:22:07.000Z","size":13613,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T21:32:54.239Z","etag":null,"topics":["aspire","aspnetcore","blazor","ci-cd","coolify","csharp","docker","docker-compose","dotnet","dotnet-aspire","ghcr","github-actions","minimal-api","opentelemetry","self-hosted"],"latest_commit_sha":null,"homepage":"https://www.fjan.nl/en/posts/how-to-deploy-a-dotnet-aspire-app-to-coolify-using-github-actions","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funsjanssen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-03T18:59:34.000Z","updated_at":"2026-04-03T19:22:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/funsjanssen/aspire-coolify-starter","commit_stats":null,"previous_names":["funsjanssen/aspire-coolify-starter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/funsjanssen/aspire-coolify-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funsjanssen%2Faspire-coolify-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funsjanssen%2Faspire-coolify-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funsjanssen%2Faspire-coolify-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funsjanssen%2Faspire-coolify-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funsjanssen","download_url":"https://codeload.github.com/funsjanssen/aspire-coolify-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funsjanssen%2Faspire-coolify-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34271500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aspire","aspnetcore","blazor","ci-cd","coolify","csharp","docker","docker-compose","dotnet","dotnet-aspire","ghcr","github-actions","minimal-api","opentelemetry","self-hosted"],"created_at":"2026-06-13T03:34:39.001Z","updated_at":"2026-06-13T03:34:40.348Z","avatar_url":"https://github.com/funsjanssen.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aspire + Coolify starter\r\n\r\nA minimal [.NET Aspire](https://learn.microsoft.com/dotnet/aspire/) solution with a Blazor web front end, a sample API, and a GitHub Actions workflow that builds container images and triggers a [Coolify](https://coolify.io/) deployment. Use it as a template for shipping Aspire-style apps to your own server.\r\n\r\n## What’s included\r\n\r\n| Piece | Role |\r\n|--------|------|\r\n| **AspireCoolifyStarter.AppHost** | Orchestrates local runs and emits Docker Compose output for container-based deployments. |\r\n| **AspireCoolifyStarter.ApiService** | ASP.NET Core minimal API with OpenAPI and a sample `/weatherforecast` endpoint. Image name: `starter-api`. |\r\n| **AspireCoolifyStarter.Web** | Blazor interactive server app that calls the API via Aspire service discovery. Image name: `starter-web`. |\r\n| **AspireCoolifyStarter.ServiceDefaults** | Shared OpenTelemetry, health checks, and service defaults. |\r\n| **AspireCoolifyStarter.Tests** | xUnit tests using `Aspire.Hosting.Testing`. |\r\n\r\nThe AppHost configures a Docker Compose environment (no custom bridge network) so generated `docker-compose` aligns with typical Coolify usage. Health checks are exposed at `/health` on both projects.\r\n\r\n## Prerequisites\r\n\r\n- [.NET 10 SDK](https://dotnet.microsoft.com/download)\r\n- [Docker](https://docs.docker.com/get-docker/) (for running the AppHost and published containers locally)\r\n- Optional: [Aspire CLI](https://learn.microsoft.com/dotnet/aspire/fundamentals/setup-tooling) (`dotnet tool install -g aspire.cli`) for Aspire-specific workflows\r\n\r\n## Local development\r\n\r\nFrom the repository root:\r\n\r\n```bash\r\naspire run\r\n```\r\n\r\nThe dashboard and service URLs are printed in the console. Run tests with:\r\n\r\n```bash\r\ndotnet test\r\n```\r\n\r\n## Build container images locally\r\n\r\nImages are produced with the built-in container publish target (names come from `ContainerImageName` in each `.csproj`):\r\n\r\n```bash\r\ndotnet publish src/AspireCoolifyStarter.ApiService/AspireCoolifyStarter.ApiService.csproj -c Release -t:PublishContainer\r\ndotnet publish src/AspireCoolifyStarter.Web/AspireCoolifyStarter.Web.csproj -c Release -t:PublishContainer\r\n```\r\n\r\n## Deploy with GitHub Actions and Coolify\r\n\r\nThe workflow [`.github/workflows/deploy-coolify.yml`](.github/workflows/deploy-coolify.yml) runs on pushes to `main` and on manual dispatch. It:\r\n\r\n1. Installs the Aspire CLI (prerelease).\r\n2. Publishes both projects as containers and pushes them to **GitHub Container Registry** as:\r\n   - `ghcr.io/\u003cyour-github-username-or-org\u003e/starter-api:latest` (and per-commit tags)\r\n   - `ghcr.io/\u003cyour-github-username-or-org\u003e/starter-web:latest` (and per-commit tags)\r\n3. Calls your Coolify deploy webhook with a bearer token.\r\n\r\n### Repository secrets\r\n\r\nConfigure these in **GitHub → Settings → Secrets and variables → Actions**:\r\n\r\n| Secret | Purpose |\r\n|--------|---------|\r\n| `COOLIFY_WEBHOOK` | Deploy webhook URL from Coolify (**Project → Webhooks**). |\r\n| `COOLIFY_TOKEN` | API token with deploy permission (**Keys \u0026 Tokens → API tokens**). |\r\n\r\nThe workflow uses `GITHUB_TOKEN` to authenticate to GHCR; ensure **Packages** write permission is allowed for the workflow (the file sets `packages: write`).\r\n\r\n### Coolify environment\r\n\r\nPoint your Coolify project at the same images the workflow pushes. When using Compose output from Aspire (see `src/AspireCoolifyStarter.AppHost/aspire-output/docker-compose.yaml` after a local run), the stack expects image and port variables such as `APISERVICE_IMAGE`, `WEBFRONTEND_IMAGE`, `APISERVICE_PORT`, and `WEBFRONTEND_PORT`. Set those to your GHCR image references and the ports Coolify should expose (commonly `8080` for each service if the app listens on that port).\r\n\r\nFor a step-by-step narrative that matches this pattern, see [Deploy a .NET Aspire app to Coolify using GitHub Actions](https://www.fjan.nl/en/posts/how-to-deploy-a-dotnet-aspire-app-to-coolify-using-github-actions).\r\n\r\n## Project layout\r\n\r\n```\r\nsrc/\r\n  AspireCoolifyStarter.AppHost/     # Aspire orchestration\r\n  AspireCoolifyStarter.ApiService/  # Backend API\r\n  AspireCoolifyStarter.Web/         # Blazor front end\r\n  AspireCoolifyStarter.ServiceDefaults/\r\ntest/\r\n  AspireCoolifyStarter.Tests/\r\n```\r\n\r\n## Contributing\r\n\r\nIssues and pull requests are welcome. Fork the repo, keep changes focused, and run `dotnet test` before submitting.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunsjanssen%2Faspire-coolify-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunsjanssen%2Faspire-coolify-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunsjanssen%2Faspire-coolify-starter/lists"}