Containerize ASP.NET Core EasyQuery samples + upgrade analysis#43
Containerize ASP.NET Core EasyQuery samples + upgrade analysis#43devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Multi-stage Dockerfiles for 11 ASP.NET Core EasyQuery sample apps - Root docker-compose.yml: 8 services build+run clean; 3 legacy SPA samples gated behind 'needs-upgrade' profile - Apps self-seed SQLite Northwind DB on startup (no external DB) - UPGRADES.md documents framework/NuGet/front-end upgrade opportunities Co-Authored-By: Ian Moritz <ian.moritz@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| razor-adhocreporting: # net8.0 (login required: /Identity/Account/Login) | ||
| build: { context: ., dockerfile: AspNetCore/Razor-Mvc/Razor.AdHocReporting/Dockerfile } | ||
| ports: ["8002:8080"] | ||
|
|
||
| razor-datafiltering: # net8.0 | ||
| build: { context: ., dockerfile: AspNetCore/Razor-Mvc/Razor.DataFiltering/Dockerfile } | ||
| ports: ["8003:8080"] | ||
|
|
||
| mvc-datafiltering: # net8.0 | ||
| build: { context: ., dockerfile: AspNetCore/Razor-Mvc/Mvc.DataFiltering/Dockerfile } | ||
| ports: ["8004:8080"] | ||
|
|
||
| blazor-server: # net6.0 (EOL) -> runs on aspnet:6.0 | ||
| build: { context: ., dockerfile: AspNetCore/Blazor/AdvancedSearch.BlazorServer/Dockerfile } | ||
| ports: ["8005:8080"] | ||
|
|
||
| blazor-wasm: # net6.0 (EOL) -> runs on aspnet:6.0 | ||
| build: { context: ., dockerfile: AspNetCore/Blazor/AdHocReporting.BlazorWasm/Server/Dockerfile } | ||
| ports: ["8006:8080"] | ||
|
|
||
| # ---- SPA-backed that build cleanly ---- | ||
| angular-advancedsearch: # net8.0 + Angular 12 (built on Node 16) | ||
| build: { context: ., dockerfile: AspNetCore/Angular/AdvancedSearch/Dockerfile } | ||
| ports: ["8007:8080"] | ||
|
|
||
| razor-ts-adhocreporting: # net8.0 + TypeScript/Rollup 4 (built on Node 20) | ||
| build: { context: ., dockerfile: AspNetCore/Razor-Mvc/RazorTypeScript.AdHocReporting/Dockerfile } | ||
| ports: ["8013:8080"] |
There was a problem hiding this comment.
🟡 Linux AdHoc containers miss the seeded reports because the app looks for a backslash path
The default compose stack now advertises the AdHoc Reporting containers as working services, but these apps run on Linux while their DefaultReportGenerator builds the seed directory as Path.Combine(env.ContentRootPath, $"App_Data\\Seed") (AspNetCore/Razor-Mvc/Razor.AdHocReporting/Services/DefaultReportGenerator.cs:23-27, AspNetCore/Razor-Mvc/RazorTypeScript.AdHocReporting/Services/DefaultReportGenerator.cs:23-27, AspNetCore/Blazor/AdHocReporting.BlazorWasm/Server/Services/DefaultReportGenerator.cs:24-28). On Linux that backslash is a literal filename character, so it looks for /app/App_Data\Seed instead of the /app/App_Data/Seed directory copied by the new Dockerfiles; first startup catches the resulting exception during default-user initialization and the demo reports are not seeded.
Prompt for agents
The AdHoc Reporting services added to docker-compose.yml run under Linux containers, but each DefaultReportGenerator currently constructs the seed directory with a Windows-style segment: Path.Combine(env.ContentRootPath, $"App_Data\\Seed"). Update the affected generators in AspNetCore/Razor-Mvc/Razor.AdHocReporting/Services/DefaultReportGenerator.cs, AspNetCore/Razor-Mvc/RazorTypeScript.AdHocReporting/Services/DefaultReportGenerator.cs, and AspNetCore/Blazor/AdHocReporting.BlazorWasm/Server/Services/DefaultReportGenerator.cs to construct the path using separate Path.Combine segments so it resolves to App_Data/Seed cross-platform. Then verify a fresh container startup creates the default demo reports.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
| COPY --from=build /out ./ | ||
| COPY ["AspNetCore/React/AdvancedSearch/App_Data/", "./App_Data/"] | ||
| ENV ASPNETCORE_URLS=http://+:8080 | ||
| ENV ASPNETCORE_ENVIRONMENT=Development |
There was a problem hiding this comment.
🟡 Profile SPA images run the published apps in Development and try to start missing dev servers
The profile-only React image sets ASPNETCORE_ENVIRONMENT=Development, but its published final stage contains only /out plus App_Data and does not include Node or the ClientApp source. In Development, Startup.Configure skips UseSpaStaticFiles() and calls spa.UseReactDevelopmentServer(...) (AspNetCore/React/AdvancedSearch/Startup.cs:80-114), so if this container ever builds successfully, UI requests will try to launch a dev server from the runtime image instead of serving the published SPA and will fail. The same Development-mode dev-server path is present in the Vue2 and Stencil profile Dockerfiles via spa.UseVueCli(...) and spa.UseProxyToSpaDevelopmentServer(...) (AspNetCore/Vue2/AdvancedSearch/Startup.cs:79-120, AspNetCore/Stencil/AdvancedSearch/Startup.cs:77-119).
Prompt for agents
The published SPA containers should run with a non-Development ASP.NET Core environment, or the app startup logic must be adjusted to serve the already-published static SPA assets inside the final image. Review the React, Vue2, and Stencil Dockerfiles' ASPNETCORE_ENVIRONMENT settings together with their Startup.UseSpa branches, and verify the final images can serve the root UI without requiring npm or a separate dev server.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
| services: | ||
| # ============ Working services (default) ============ | ||
|
|
||
| # ---- Pure ASP.NET Core (no Node build) ---- | ||
| razor-advancedsearch: # net8.0 | ||
| build: { context: ., dockerfile: AspNetCore/Razor-Mvc/Razor.AdvancedSearch/Dockerfile } | ||
| ports: ["8001:8080"] | ||
|
|
||
| razor-adhocreporting: # net8.0 (login required: /Identity/Account/Login) | ||
| build: { context: ., dockerfile: AspNetCore/Razor-Mvc/Razor.AdHocReporting/Dockerfile } | ||
| ports: ["8002:8080"] | ||
|
|
||
| razor-datafiltering: # net8.0 | ||
| build: { context: ., dockerfile: AspNetCore/Razor-Mvc/Razor.DataFiltering/Dockerfile } | ||
| ports: ["8003:8080"] | ||
|
|
||
| mvc-datafiltering: # net8.0 | ||
| build: { context: ., dockerfile: AspNetCore/Razor-Mvc/Mvc.DataFiltering/Dockerfile } | ||
| ports: ["8004:8080"] | ||
|
|
||
| blazor-server: # net6.0 (EOL) -> runs on aspnet:6.0 | ||
| build: { context: ., dockerfile: AspNetCore/Blazor/AdvancedSearch.BlazorServer/Dockerfile } | ||
| ports: ["8005:8080"] | ||
|
|
||
| blazor-wasm: # net6.0 (EOL) -> runs on aspnet:6.0 | ||
| build: { context: ., dockerfile: AspNetCore/Blazor/AdHocReporting.BlazorWasm/Server/Dockerfile } | ||
| ports: ["8006:8080"] | ||
|
|
||
| # ---- SPA-backed that build cleanly ---- | ||
| angular-advancedsearch: # net8.0 + Angular 12 (built on Node 16) | ||
| build: { context: ., dockerfile: AspNetCore/Angular/AdvancedSearch/Dockerfile } | ||
| ports: ["8007:8080"] | ||
|
|
||
| razor-ts-adhocreporting: # net8.0 + TypeScript/Rollup 4 (built on Node 20) | ||
| build: { context: ., dockerfile: AspNetCore/Razor-Mvc/RazorTypeScript.AdHocReporting/Dockerfile } | ||
| ports: ["8013:8080"] |
There was a problem hiding this comment.
🚩 Running default containers as Development is mostly intentional for these demos but has side effects
Most non-SPA and Angular/Blazor containers set ASPNETCORE_ENVIRONMENT=Development, which suppresses HSTS and enables developer exception pages/migration endpoints in several projects. For the documented sample/demo use case this appears intentional, and UPGRADES.md calls out the HTTP-only redirect warning as harmless for demos, so I did not classify it as a security bug. If these images are published beyond local demos, reviewers should decide whether to switch the default environment to Production and handle HTTPS/proxy configuration explicitly.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
End-to-end container test resultsRan Important The interactive EasyQuery query-builder widget (add condition → run query) is blocked by a "No license key for EasyQuery" popup on every sample. This is pre-existing and not a containerization defect: the repo ships blank Walkthrough recordingView original video (dotnetsamples-containers-edited.mp4) ★ Core proof — MVC Data Filtering (8004): 830 seeded Northwind recordsServer-rendered Orders grid pulls real data from the SQLite DB seeded inside the container on startup. Assertions (8 passed, 1 untested)
More screenshotsRazor Advanced Search (8001) — EQ UI shell in-container RazorTS Ad-hoc Reporting (8013) — authenticated as demo@korzh.com Tested by Devin — session: https://app.devin.ai/sessions/65e5330d495b49868deef5754257aadc |
Summary
Adds Docker support for the Linux-runnable ASP.NET Core samples and documents concrete upgrade opportunities found while building them. The repo previously had no containerization (no Dockerfiles/compose).
Dockerfileper project + rootdocker-compose.yml.App_Data/EqDemoData.zip, so no external DB is needed.docker compose up -d --buildbrings up 8 services that build and serve HTTP 200 (verified). 3 legacy SPA samples that currently fail to build are gated behind aneeds-upgradeprofile so they don't break the defaultup.UPGRADES.mdcaptures framework / NuGet / front-end upgrade findings (evidence-based, observed during the builds).Services (verified
up -d --build, all HTTP 200)net6.0apps build with the .NET 8 SDK and run onaspnet:6.0;net8.0apps run onaspnet:8.0. SPA build stages copy Node into the SDK image (COPY --from=node:16/20 ...).Not containerized
AspNet4/,WinForms/,Wpf/— .NET Framework /net*-windows, Windows-only, can't run in Linux containers.Vue3andAngular/AdHocReportinguse a VS JavaScript.esproj+SpaProxybuild that needs a headless-Node refactor first.Key upgrade findings (see
UPGRADES.mdfor detail)net6.0is EOL (2024-11-12) → move Blazor/Vue/React/Stencil projects to net8.0 (LTS); this also moves their images off the EOLaspnet:6.0base.6.0.1/8.0.2/8.0.4/8.0.5→ align on latest8.0.x.Microsoft.Data.SqlClient 2.1.7,System.Data.SqlClient 4.8.6,System.Net.Http 4.3.4,System.Text.RegularExpressions 4.3.1,System.Drawing.Common 4.7.x.Korzh.EasyQuery.* 7.4.0 → 7.4.2,EasyData.Exporters.* 1.5.8/1.5.9 → 1.5.12,Korzh.DbUtils.* → 1.4.3;AspNet4still on7.4.0-rc04prerelease.react-scripts ^1.1.5(Failed to minify), Vue@vue/cli-service ^3(TS strict-init errors), Stencil 2 (prerender crash), Angular 12 (Node-16-only). Recommend modern equivalents (CRA 5/Vite, Vue 3 + Vite, Stencil 4, Angular 17/18).Notes
Link to Devin session: https://app.devin.ai/sessions/65e5330d495b49868deef5754257aadc
Requested by: @iancmoritz
Devin Review
1e7f592