Last active
January 19, 2026 09:51
-
-
Save AaronSadlerUK/55913d4d9574a48e4057b27ef8e56ead to your computer and use it in GitHub Desktop.
GreenStack Configuration Samples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Git | |
| .git | |
| .gitignore | |
| .gitattributes | |
| */.github | |
| # Build outputs | |
| **/bin/ | |
| **/obj/ | |
| **/out/ | |
| **/publish/ | |
| # Visual Studio / Rider | |
| .vs/ | |
| .vscode/ | |
| .idea/ | |
| *.suo | |
| *.user | |
| *.userosscache | |
| *.sln.docstates | |
| *.userprefs | |
| .idea/ | |
| # NuGet | |
| *.nupkg | |
| *.snupkg | |
| packages/ | |
| .nuget/ | |
| # Test results | |
| [Tt]est[Rr]esult*/ | |
| [Bb]uild[Ll]og.* | |
| *.trx | |
| *.coverage | |
| # Umbraco specific | |
| **/App_Data/ | |
| **/umbraco/Data/ | |
| **/umbraco/Logs/ | |
| **/wwwroot/media/ | |
| umbraco.config | |
| # Node modules (if you have front-end build) | |
| **/node_modules/ | |
| **/npm-debug.log | |
| **/yarn-error.log | |
| # OS files | |
| .DS_Store | |
| Thumbs.db | |
| *.swp | |
| *.swo | |
| *~ | |
| # Docker | |
| Dockerfile | |
| .dockerignore | |
| docker-compose*.yml | |
| *.md | |
| # CI/CD | |
| .github/ | |
| .gitlab-ci.yml | |
| azure-pipelines.yml | |
| # Logs | |
| *.log | |
| logs/ | |
| # Environment files | |
| .env | |
| .env.* | |
| !.env.example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Umbraco": { | |
| "CMS": { | |
| "HealthChecks": { | |
| "DisabledChecks": [ | |
| { | |
| "Id": "E2048C48-21C5-4BE1-A80B-8062162DF124" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Umbraco.Cms.Core.Composing; | |
| using Umbraco.Cms.Infrastructure.Runtime.RuntimeModeValidators; | |
| public class DockerChecksRemover : IComposer | |
| { | |
| public void Compose(IUmbracoBuilder builder) | |
| => builder.RuntimeModeValidators().Remove<UseHttpsValidator>(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base | |
| WORKDIR /app | |
| EXPOSE 8080 | |
| FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build | |
| ARG BUILD_CONFIGURATION=Release | |
| WORKDIR /src | |
| COPY . ./ | |
| RUN dotnet restore "WEB_PROJECT_FOLDER/WEB_PROJECT_NAME.csproj" --locked-mode | |
| RUN dotnet build "WEB_PROJECT_FOLDER/WEB_PROJECT_NAME.csproj" -c $BUILD_CONFIGURATION --no-restore | |
| FROM build AS publish | |
| RUN dotnet publish "WEB_PROJECT_FOLDER/WEB_PROJECT_NAME.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false --no-build | |
| FROM base AS final | |
| WORKDIR /app | |
| COPY --from=publish /app/publish . | |
| ENTRYPOINT ["dotnet", "WEB_PROJECT_NAME.dll", "--console-logger-format=json"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Push Docker Image | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: GITHUB_ACCOUNT_NAME/DOCKER_IMAGE_NAME | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: 'true' | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate timestamp | |
| id: timestamp | |
| run: echo "tag=$(date +'%H%M%S%d%m%Y')" >> $GITHUB_OUTPUT | |
| - name: Build and push | |
| working-directory: ./ | |
| run: | | |
| docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.timestamp.outputs.tag }} . | |
| docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.timestamp.outputs.tag }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.timestamp.outputs.tag }} | |
| docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| echo "Published: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.timestamp.outputs.tag }}" | |
| - name: Trigger webhook | |
| run: curl -fS -X POST ${{secrets.WEBHOOK_ENDPOINT}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.AspNetCore.HttpOverrides; | |
| WebApplicationBuilder builder = WebApplication.CreateBuilder(args); | |
| builder.Services.Configure<ForwardedHeadersOptions>(options => | |
| { | |
| options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; | |
| options.RequireHeaderSymmetry = false; | |
| options.KnownIPNetworks.Clear(); | |
| options.KnownProxies.Clear(); | |
| }); | |
| builder.CreateUmbracoBuilder() | |
| .AddBackOffice() | |
| .AddWebsite() | |
| .AddComposers() | |
| .Build(); | |
| WebApplication app = builder.Build(); | |
| app.UseForwardedHeaders(); | |
| await app.BootUmbracoAsync(); | |
| app.UseUmbraco() | |
| .WithMiddleware(u => | |
| { | |
| u.UseBackOffice(); | |
| u.UseWebsite(); | |
| }) | |
| .WithEndpoints(u => | |
| { | |
| u.UseBackOfficeEndpoints(); | |
| u.UseWebsiteEndpoints(); | |
| }); | |
| await app.RunAsync(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment