Merge pull request #4 from MauMauStudios/feature/deploymaunt-docker

Feature/deploymaunt docker
This commit is contained in:
Jordan Geurtsen
2023-03-22 10:14:14 +01:00
committed by GitHub
7 changed files with 45 additions and 4 deletions

4
.dockerignore Normal file
View File

@@ -0,0 +1,4 @@
.idea/
.git/
.gitignore
README.md

3
.gitignore vendored
View File

@@ -3,3 +3,6 @@ bin
obj
Properties
appsettings.Local.json
.git
*.DotSettings.user
*.sln

View File

@@ -5,7 +5,7 @@ namespace MauMau_Server.Controllers;
[ApiController]
[Route("[controller]")]
public class DeckController : ControllerBase
public class MauController : ControllerBase
{
[HttpGet("deck")]
public IActionResult GetDeck()

20
Dockerfile Normal file
View File

@@ -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 ["MauMau-Server.csproj", "./"]
RUN dotnet restore "MauMau-Server.csproj"
COPY . .
WORKDIR "/src"
RUN dotnet build "MauMau-Server.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "MauMau-Server.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MauMau-Server.dll"]

View File

@@ -4,7 +4,6 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MauMau_Server</RootNamespace>
</PropertyGroup>
<ItemGroup>
@@ -12,5 +11,4 @@
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>
</Project>

17
docker-compose.yml Normal file
View File

@@ -0,0 +1,17 @@
version: '3.9'
services:
server:
build:
context: .
dockerfile: Dockerfile
#target: final
container_name: 'MauMau-Server'
restart: always
ports:
- "80:80"
networks:
- MauMau
networks:
MauMau:
# hier later extern naar client
driver: bridge

View File

@@ -1 +0,0 @@
{"CardType":"SPADES","CardValue":"THREE"}