commit bbec747bb707894338c78c901bf8175f40773f12 Author: AppFactory Bot Date: Fri Jun 12 10:26:56 2026 +0000 Initial .NET API service diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..306001a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +bin/ +obj/ +.git/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..02c0539 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY . . +RUN dotnet publish "Idoklad.csproj" -c Release -o /app/publish + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 +WORKDIR /app +ENV ASPNETCORE_URLS=http://+:8080 +EXPOSE 8080 +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "Idoklad.dll"] diff --git a/Idoklad.csproj b/Idoklad.csproj new file mode 100644 index 0000000..24ec0e8 --- /dev/null +++ b/Idoklad.csproj @@ -0,0 +1,7 @@ + + + net8.0 + enable + enable + + diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..f2944f3 --- /dev/null +++ b/Program.cs @@ -0,0 +1,22 @@ +var builder = WebApplication.CreateBuilder(args); +var app = builder.Build(); + +var rootPath = Environment.GetEnvironmentVariable("ROOT_PATH"); +if (!string.IsNullOrWhiteSpace(rootPath)) +{ + app.UsePathBase(rootPath); +} + +app.MapGet("/", () => Results.Json(new +{ + name = "iDoklad", + service = "idoklad", + status = "ok" +})); + +app.MapGet("/health", () => Results.Json(new +{ + status = "ok" +})); + +app.Run(); diff --git a/README.md b/README.md new file mode 100644 index 0000000..2e7dda2 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# iDoklad + +.NET API služba vytvořená přes CSBot Services Portal. + +## Endpointy + +- GET / +- GET /health diff --git a/appsettings.json b/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}