Some housekeeping

This commit is contained in:
Saphire 2023-10-29 13:09:47 +06:00
parent a029fa4b48
commit 309b4345f1
Signed by: Saphire
GPG Key ID: B26EB7A1F07044C4
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build-env
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers, build
@ -25,7 +25,7 @@ RUN npx vite build --emptyOutDir --outDir ../wwwroot
WORKDIR /app
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine
WORKDIR /app
COPY --from=build-env /app/out/ ./
COPY --from=frontend-build-env /app/wwwroot/ ./wwwroot/

View File

@ -1,6 +1,7 @@
using Lunar.Exchange.Lapis.Data;
using Lunar.Exchange.Lapis.Models;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
@ -67,6 +68,11 @@ builder.Services
var app = builder.Build();
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
{
using var scope = app.Services.CreateScope();
using var context = scope.ServiceProvider.GetRequiredService<LapisContext>();