diff --git a/DnDBattlefield/Data/AppDbContext.cs b/DnDBattlefield/Data/AppDbContext.cs new file mode 100644 index 0000000000000000000000000000000000000000..f40a6559489a26689750dd30b917f1692a3c2e34 --- /dev/null +++ b/DnDBattlefield/Data/AppDbContext.cs @@ -0,0 +1,14 @@ +using Microsoft.EntityFrameworkCore; + +namespace DnDSpilleplade.API.Data +{ + public class AppDbContext : DbContext + { + + public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) + { + + } + } +} + diff --git a/DnDBattlefield/DnDBattlefield.csproj b/DnDBattlefield/DnDBattlefield.csproj new file mode 100644 index 0000000000000000000000000000000000000000..05284a8bc5dacf65bdc2510c5b6c0abd67d44f9d --- /dev/null +++ b/DnDBattlefield/DnDBattlefield.csproj @@ -0,0 +1,18 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net9.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.3"> + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> + <PrivateAssets>all</PrivateAssets> + </PackageReference> + <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" /> + </ItemGroup> + +</Project> diff --git a/DnDBattlefield/Program.cs b/DnDBattlefield/Program.cs new file mode 100644 index 0000000000000000000000000000000000000000..3751555cbd32d09340c8cb7b75ce8311c4330054 --- /dev/null +++ b/DnDBattlefield/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/DnDBattlefield/docker-compose.yml b/DnDBattlefield/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..57a47b3a529b41e4970c8d5c5c56b5f4c1171dfc --- /dev/null +++ b/DnDBattlefield/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.9' + +services: + api: + build: + context: . + dockerfile: DnDSpilleplade.API/Dockerfile + ports: + - "5000:80" + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ConnectionStrings__DefaultConnection=Server=sqlserver;Database=DnDDB;User=sa;Password=Your_password123; + depends_on: + - sqlserver + + sqlserver: + image: mcr.microsoft.com/mssql/server:2022-latest + environment: + SA_PASSWORD: "Your_password123" + ACCEPT_EULA: "Y" + ports: + - "1433:1433" diff --git a/DnDBattlefield/dockerfile b/DnDBattlefield/dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3d38b84d5dc58f753151a0ed3986105c791fa23c --- /dev/null +++ b/DnDBattlefield/dockerfile @@ -0,0 +1,20 @@ +# Use the official .NET 9 SDK image to build the app +FROM mcr.microsoft.com/dotnet/sdk:9.0-preview AS build +WORKDIR /app + +# Copy solution and project files +COPY *.sln . +COPY DnDSpilleplade.API/*.csproj ./DnDSpilleplade.API/ +COPY DnDSpilleplade.Data/*.csproj ./DnDSpilleplade.Data/ +RUN dotnet restore + +# Copy the rest of the source code +COPY . . +WORKDIR /app/DnDSpilleplade.API +RUN dotnet publish -c Release -o out + +# Runtime image (ASP.NET Core 9 preview) +FROM mcr.microsoft.com/dotnet/aspnet:9.0-preview +WORKDIR /app +COPY --from=build /app/DnDSpilleplade.API/out ./ +ENTRYPOINT ["dotnet", "DnDSpilleplade.API.dll"] diff --git a/dnd-battlefield.sln b/dnd-battlefield.sln new file mode 100644 index 0000000000000000000000000000000000000000..b28a12d17a5b2f5cf14ec1e736c7a0f134152019 --- /dev/null +++ b/dnd-battlefield.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DnDBattlefield", "DnDBattlefield\DnDBattlefield.csproj", "{7339DEAA-3CFC-DC3F-4E87-8A8EF05B6965}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7339DEAA-3CFC-DC3F-4E87-8A8EF05B6965}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7339DEAA-3CFC-DC3F-4E87-8A8EF05B6965}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7339DEAA-3CFC-DC3F-4E87-8A8EF05B6965}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7339DEAA-3CFC-DC3F-4E87-8A8EF05B6965}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CD890992-A0AD-4A6B-93FB-11B6B3DD0BB2} + EndGlobalSection +EndGlobal