Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 48cbfee49c | |||
| c2d8d34902 | |||
| c7e2c69733 |
@@ -0,0 +1,10 @@
|
||||
**/bin/
|
||||
**/obj/
|
||||
**/*.user
|
||||
**/.vs/
|
||||
.idea/
|
||||
.vscode/
|
||||
.git/
|
||||
.gitea/
|
||||
.github/
|
||||
**/logs/
|
||||
@@ -14,6 +14,7 @@ jobs:
|
||||
- OmegaLeo.HelperLib.Game
|
||||
- OmegaLeo.HelperLib.Documentation
|
||||
- OmegaLeo.HelperLib.Shared
|
||||
- OmegaLeo.HelperLib.Steamworks
|
||||
env:
|
||||
VERSION: ${{ github.event.release.tag_name }}
|
||||
PACKAGE: ./${{ matrix.project }}/bin/Release/${{ matrix.project }}.${{ github.event.release.tag_name }}.nupkg
|
||||
|
||||
@@ -4,13 +4,9 @@ obj/
|
||||
riderModule.iml
|
||||
/_ReSharper.Caches/
|
||||
/.vs
|
||||
<<<<<<< Updated upstream
|
||||
/OmegaLeo.HelperLib.Web
|
||||
=======
|
||||
/OmegaLeo.HelperLib.Web/.config
|
||||
/OmegaLeo.HelperLib.Web/Properties/PublishProfiles
|
||||
/OmegaLeo.HelperLib.Web/publish
|
||||
>>>>>>> Stashed changes
|
||||
/OmegaLeo.HelperLib.Web/OmegaLeo.HelperLib.Web.csproj.user
|
||||
|
||||
*.sh
|
||||
@@ -0,0 +1,15 @@
|
||||
# Build context is the repository root (the Web project references sibling library projects).
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
RUN dotnet publish "OmegaLeo.HelperLib.Web/OmegaLeo.HelperLib.Web.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/publish .
|
||||
# Serilog writes to /app/logs; make it writable for the non-root "app" user.
|
||||
RUN mkdir -p /app/logs && chown -R app:app /app/logs
|
||||
USER app
|
||||
ENV ASPNETCORE_HTTP_PORTS=8080
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["dotnet", "OmegaLeo.HelperLib.Web.dll"]
|
||||
@@ -1,3 +1,4 @@
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Serilog;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -5,6 +6,15 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllersWithViews();
|
||||
|
||||
// Trust X-Forwarded-* from the reverse proxy in front of the container, so HTTPS
|
||||
// redirection and HSTS see the original scheme instead of looping on plain HTTP.
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
options.KnownNetworks.Clear();
|
||||
options.KnownProxies.Clear();
|
||||
});
|
||||
|
||||
// Configure logging
|
||||
// Configure Serilog
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
@@ -20,6 +30,8 @@ builder.Host.UseSerilog();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseForwardedHeaders();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
services:
|
||||
helperlib-web:
|
||||
container_name: helperlib-web
|
||||
build:
|
||||
context: .
|
||||
dockerfile: OmegaLeo.HelperLib.Web/Dockerfile
|
||||
image: helperlib-web:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
ASPNETCORE_ENVIRONMENT: Production
|
||||
ports:
|
||||
# Cloudflare Tunnel: library.omegaleo.dev -> http://localhost:5001
|
||||
- "${HELPERLIB_WEB_PORT:-5001}:8080"
|
||||
volumes:
|
||||
- helperlib-web-logs:/app/logs
|
||||
|
||||
volumes:
|
||||
helperlib-web-logs:
|
||||
Reference in New Issue
Block a user