Sem docker
This commit is contained in:
parent
6ff40a833f
commit
dc3351a5f8
|
|
@ -1,11 +0,0 @@
|
|||
.git
|
||||
.github
|
||||
.vs
|
||||
bin
|
||||
obj
|
||||
**/bin
|
||||
**/obj
|
||||
*.user
|
||||
*.suo
|
||||
*.log
|
||||
README.md
|
||||
20
Dockerfile
20
Dockerfile
|
|
@ -1,20 +0,0 @@
|
|||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
COPY ["line-gestao-api.csproj", "./"]
|
||||
RUN dotnet restore "./line-gestao-api.csproj"
|
||||
|
||||
COPY . .
|
||||
RUN dotnet publish "./line-gestao-api.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
|
||||
WORKDIR /app
|
||||
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||
|
||||
COPY --from=build /app/publish .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["dotnet", "line-gestao-api.dll"]
|
||||
|
|
@ -4,6 +4,7 @@ using line_gestao_api.Models;
|
|||
using line_gestao_api.Services;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
|
@ -11,6 +12,12 @@ using Microsoft.IdentityModel.Tokens;
|
|||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
options.KnownIPNetworks.Clear();
|
||||
options.KnownProxies.Clear();
|
||||
});
|
||||
|
||||
builder.Services.Configure<FormOptions>(o =>
|
||||
{
|
||||
|
|
@ -97,6 +104,7 @@ builder.Services.AddHostedService<VigenciaNotificationBackgroundService>();
|
|||
builder.Services.Configure<SeedOptions>(builder.Configuration.GetSection("Seed"));
|
||||
|
||||
var app = builder.Build();
|
||||
app.UseForwardedHeaders();
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"Cors": {
|
||||
"AllowedOrigins": [
|
||||
"https://linegestao.inglinesystems.com.br"
|
||||
]
|
||||
},
|
||||
"App": {
|
||||
"UseHttpsRedirection": true
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue