diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cd967fc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/.idea +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/.idea/.idea.PaydayBackend/.idea/encodings.xml b/.idea/.idea.PaydayBackend/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.PaydayBackend/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.PaydayBackend/.idea/indexLayout.xml b/.idea/.idea.PaydayBackend/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.PaydayBackend/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.PaydayBackend/.idea/projectSettingsUpdater.xml b/.idea/.idea.PaydayBackend/.idea/projectSettingsUpdater.xml new file mode 100644 index 0000000..4bb9f4d --- /dev/null +++ b/.idea/.idea.PaydayBackend/.idea/projectSettingsUpdater.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/PaydayBackend.sln b/PaydayBackend.sln new file mode 100644 index 0000000..b6bcfc1 --- /dev/null +++ b/PaydayBackend.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaydayBackend", "PaydayBackend\PaydayBackend.csproj", "{6676FA61-5790-4E2A-B111-49382E66C194}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6676FA61-5790-4E2A-B111-49382E66C194}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6676FA61-5790-4E2A-B111-49382E66C194}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6676FA61-5790-4E2A-B111-49382E66C194}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6676FA61-5790-4E2A-B111-49382E66C194}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/PaydayBackend/Dockerfile b/PaydayBackend/Dockerfile new file mode 100644 index 0000000..00d00bb --- /dev/null +++ b/PaydayBackend/Dockerfile @@ -0,0 +1,20 @@ +FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +WORKDIR /src +COPY ["PaydayBackend/PaydayBackend.csproj", "PaydayBackend/"] +RUN dotnet restore "PaydayBackend/PaydayBackend.csproj" +COPY . . +WORKDIR "/src/PaydayBackend" +RUN dotnet build "PaydayBackend.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "PaydayBackend.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "PaydayBackend.dll"] diff --git a/PaydayBackend/PaydayBackend.csproj b/PaydayBackend/PaydayBackend.csproj new file mode 100644 index 0000000..615a08c --- /dev/null +++ b/PaydayBackend/PaydayBackend.csproj @@ -0,0 +1,25 @@ + + + + net7.0 + enable + enable + Linux + + + + + + + + + + .dockerignore + + + + + + + + diff --git a/PaydayBackend/Program.cs b/PaydayBackend/Program.cs new file mode 100644 index 0000000..8264bac --- /dev/null +++ b/PaydayBackend/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); \ No newline at end of file diff --git a/PaydayBackend/Properties/launchSettings.json b/PaydayBackend/Properties/launchSettings.json new file mode 100644 index 0000000..c4d62b3 --- /dev/null +++ b/PaydayBackend/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:9171", + "sslPort": 44329 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5053", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7004;http://localhost:5053", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/PaydayBackend/appsettings.Development.json b/PaydayBackend/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/PaydayBackend/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/PaydayBackend/appsettings.json b/PaydayBackend/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/PaydayBackend/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}