mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 13:01:10 +00:00
Adds per-platform release artifacts and release image validation
This commit is contained in:
1 parent
92ab62011e
commit
68143dff25
19 files changed
+603
-115
No files matched your search
@@ -62,9 +62,8 @@ WORKDIR /app
|
||||
|
||||
# The app user must own the published files, because the plugin installer writes into /app/plugins.
|
||||
COPY --from=publish --chown=app:app /app/publish .
|
||||
# The HTTP port is controlled per run mode: launchSettings.json for local development, ASPNETCORE_HTTP_PORTS here for
|
||||
# Docker, and for a published DLL run directly on a host, ASPNETCORE_URLS (or ASPNETCORE_HTTP_PORTS) must be set.
|
||||
ENV ASPNETCORE_HTTP_PORTS=5214
|
||||
# The container branch in Program.cs binds the API to this port. Direct published runs default to the documented address
|
||||
# and can override it with ASPNETCORE_URLS, ASPNETCORE_HTTP_PORTS or ASPNETCORE_HTTPS_PORTS.
|
||||
EXPOSE 5214
|
||||
ENTRYPOINT ["dotnet", "Nemera.Presentation.Api.dll"]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This image ships the published release artifacts, so the recorded plugin hashes and the image contents are the same files.
|
||||
# Build it with the published API directory as the context:
|
||||
# docker build -t nemera-api -f src/Nemera.Presentation.Api/Dockerfile.release bin/api/publish
|
||||
# Build it with the extracted Linux x64 API archive as the context.
|
||||
# docker build -t nemera-api -f src/Nemera.Presentation.Api/Dockerfile.release <extracted-Nemera-version-linux-x64-api>
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
|
||||
|
||||
# Curl is used by the container healthcheck to probe the /health endpoints.
|
||||
@@ -16,6 +16,6 @@ WORKDIR /app
|
||||
# The app user must own the published files, because the plugin installer writes into /app/plugins.
|
||||
COPY --chown=app:app . .
|
||||
|
||||
ENV ASPNETCORE_HTTP_PORTS=5214
|
||||
# The container branch in Program.cs binds the API to this port.
|
||||
EXPOSE 5214
|
||||
ENTRYPOINT ["dotnet", "Nemera.Presentation.Api.dll"]
|
||||
@@ -9,6 +9,8 @@
|
||||
<ContainerRepository>nemera-api</ContainerRepository>
|
||||
<DockerfileTag>nemera-api</DockerfileTag>
|
||||
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
<!-- The release restore sets this environment variable to restore every supported runtime in one pass. -->
|
||||
<RuntimeIdentifiers Condition="'$(NEMERA_RELEASE_RUNTIME_IDENTIFIERS)' != ''">$(NEMERA_RELEASE_RUNTIME_IDENTIFIERS)</RuntimeIdentifiers>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(OfficialReleaseBuild)' == 'true'">
|
||||
<DefineConstants>$(DefineConstants);OFFICIAL_RELEASE_BUILD</DefineConstants>
|
||||
|
||||
@@ -74,7 +74,16 @@ public class Program
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
logPath = Path.Combine(AppContext.BaseDirectory, "logs"); // Use local binary path.
|
||||
// A published build used to fall back to the framework's port 5000. Keep the documented default only when the host
|
||||
// did not provide an address or a port through configuration, including ASPNETCORE_URLS, ASPNETCORE_HTTP_PORTS
|
||||
// and ASPNETCORE_HTTPS_PORTS.
|
||||
if (string.IsNullOrWhiteSpace(builder.Configuration["Urls"])
|
||||
&& string.IsNullOrWhiteSpace(builder.Configuration["HTTP_PORTS"])
|
||||
&& string.IsNullOrWhiteSpace(builder.Configuration["HTTPS_PORTS"]))
|
||||
builder.WebHost.UseUrls("http://localhost:5214");
|
||||
}
|
||||
Directory.CreateDirectory(logPath);
|
||||
if (!logPath.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
||||
logPath = logPath += Path.DirectorySeparatorChar;
|
||||
|
||||
@@ -47,9 +47,8 @@ FROM base AS final
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=publish --chown=app:app /app/publish .
|
||||
# The HTTP port is controlled per run mode: launchSettings.json for local development, ASPNETCORE_HTTP_PORTS here for
|
||||
# Docker, and for a published DLL run directly on a host, ASPNETCORE_URLS (or ASPNETCORE_HTTP_PORTS) must be set.
|
||||
ENV ASPNETCORE_HTTP_PORTS=5012
|
||||
# The container branch in Program.cs binds the web client to this port. Direct published runs default to the documented
|
||||
# address and can override it with ASPNETCORE_URLS, ASPNETCORE_HTTP_PORTS or ASPNETCORE_HTTPS_PORTS.
|
||||
EXPOSE 5012
|
||||
ENTRYPOINT ["dotnet", "Nemera.Presentation.Web.dll"]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This image ships the published release artifacts, so the image contents are the same files the release workflow exported.
|
||||
# Build it with the published Web directory as the context:
|
||||
# docker build -t nemera-web -f src/Nemera.Presentation.Web/Dockerfile.release bin/web/publish
|
||||
# Build it with the extracted Linux x64 Web archive as the context.
|
||||
# docker build -t nemera-web -f src/Nemera.Presentation.Web/Dockerfile.release <extracted-Nemera-version-linux-x64-web>
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
|
||||
|
||||
# Curl is used by the container healthcheck to probe the /health endpoints.
|
||||
@@ -14,6 +14,6 @@ WORKDIR /app
|
||||
|
||||
COPY --chown=app:app . .
|
||||
|
||||
ENV ASPNETCORE_HTTP_PORTS=5012
|
||||
# The container branch in Program.cs binds the web client to this port.
|
||||
EXPOSE 5012
|
||||
ENTRYPOINT ["dotnet", "Nemera.Presentation.Web.dll"]
|
||||
@@ -11,6 +11,8 @@
|
||||
<ContainerRepository>nemera-web</ContainerRepository>
|
||||
<DockerfileTag>nemera-web</DockerfileTag>
|
||||
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
<!-- The release restore sets this environment variable to restore every supported runtime in one pass. -->
|
||||
<RuntimeIdentifiers Condition="'$(NEMERA_RELEASE_RUNTIME_IDENTIFIERS)' != ''">$(NEMERA_RELEASE_RUNTIME_IDENTIFIERS)</RuntimeIdentifiers>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FastEndpoints;
|
||||
using Nemera.Presentation.Web.Common.DependencyInjection;
|
||||
using Nemera.Presentation.Web.Common.HealthChecks;
|
||||
using Nemera.Presentation.Web.Common.Utilities;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@@ -11,6 +8,9 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Nemera.Presentation.Web.Common.DependencyInjection;
|
||||
using Nemera.Presentation.Web.Common.HealthChecks;
|
||||
using Nemera.Presentation.Web.Common.Utilities;
|
||||
using Scalar.AspNetCore;
|
||||
using Serilog;
|
||||
using System;
|
||||
@@ -50,7 +50,16 @@ public class Program
|
||||
builder.WebHost.ConfigureKestrel(options => options.ListenAnyIP(5012)); // HTTP only.
|
||||
}
|
||||
else
|
||||
{
|
||||
logPath = Path.Combine(AppContext.BaseDirectory, "logs"); // Use local binary path.
|
||||
// A published build used to fall back to the framework's port 5000. Keep the documented default only when the host
|
||||
// did not provide an address or a port through configuration, including ASPNETCORE_URLS, ASPNETCORE_HTTP_PORTS
|
||||
// and ASPNETCORE_HTTPS_PORTS.
|
||||
if (string.IsNullOrWhiteSpace(builder.Configuration["Urls"])
|
||||
&& string.IsNullOrWhiteSpace(builder.Configuration["HTTP_PORTS"])
|
||||
&& string.IsNullOrWhiteSpace(builder.Configuration["HTTPS_PORTS"]))
|
||||
builder.WebHost.UseUrls("http://localhost:5012");
|
||||
}
|
||||
Directory.CreateDirectory(logPath);
|
||||
if (!logPath.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
||||
logPath = logPath += Path.DirectorySeparatorChar;
|
||||
|
||||
@@ -366,6 +366,7 @@
|
||||
<File Path="../global.json" />
|
||||
<File Path="../build/build.proj" />
|
||||
<File Path="../build/BundledPlugins.props" />
|
||||
<File Path="../build/RuntimeIdentifiers.props" />
|
||||
<File Path="../build/BundledPlugins.manifest" />
|
||||
<File Path="../build/BundledPlugins.deny.manifest" />
|
||||
<File Path="../src/Nemera.Presentation.Api/Dockerfile.release" />
|
||||
|
||||
Reference in new issue
Block a user