This commit is contained in:
bronku 2025-11-10 14:55:25 +01:00
commit 646805c693
7 changed files with 48 additions and 0 deletions

5
README.md Normal file
View file

@ -0,0 +1,5 @@
```sh
git clone <url>
cd <dir>
docker compose up -d --build
```

7
docker-compose.yml Normal file
View file

@ -0,0 +1,7 @@
services:
dotnet:
build: ./dotnet
environment:
- PORT=5000
ports:
- "5000:5000"

6
dotnet/.dockerignore Normal file
View file

@ -0,0 +1,6 @@
.git
.gitignore
obj
bin
Properties
appsettings*

4
dotnet/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
obj
bin
Properties
appsettings*

8
dotnet/Dockerfile Normal file
View file

@ -0,0 +1,8 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY *.csproj .
RUN dotnet restore
COPY . .
CMD ["dotnet", "run"]

9
dotnet/Program.cs Normal file
View file

@ -0,0 +1,9 @@
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
var port = Environment.GetEnvironmentVariable("PORT") ?? "5000";
var url = $"http://0.0.0.0:{port}";
app.MapGet("", () => "Hello World!");
app.Run(url);

9
dotnet/dotnet.csproj Normal file
View file

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>