Merge pull request #2 from MauMauStudios/feature/deploymaunt-docker_new_attempt

.NET Dockerfile
This commit is contained in:
Jordan Geurtsen
2023-03-22 10:08:45 +01:00
committed by GitHub
7 changed files with 29 additions and 23 deletions

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()

View File

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

View File

@@ -1,10 +1,15 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS base
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
COPY ../ /src/
WORKDIR /src
RUN dotnet build "MauMau-Server.csproj" -c Release -o out
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

View File

@@ -4,9 +4,6 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MauMau_Server</RootNamespace>
<AssemblyName>MauMau_Server</AssemblyName>
<OutputPath>out\</OutputPath>
</PropertyGroup>
<ItemGroup>

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"}