2026-06-04 19:09:31 +03:30
|
|
|
# Hokm.Server (.NET 10 ASP.NET Core + SignalR)
|
|
|
|
|
# Build context = ./server (so Hokm.Engine + Hokm.Server are both in scope)
|
|
|
|
|
FROM mirror.soroushasadi.com/dotnet/sdk:10.0 AS build
|
|
|
|
|
WORKDIR /src
|
2026-06-04 19:59:27 +03:30
|
|
|
# NuGet feed. Default = HTTPS Nexus (CI runner trusts the cert). Override with
|
|
|
|
|
# NUGET_INDEX=http://<nexus-ip>:8081/repository/nuget-group/index.json for hosts
|
|
|
|
|
# whose trust store lacks the mirror's intermediate (PartialChain) — e.g. local
|
|
|
|
|
# Docker Desktop. allowInsecureConnections lets .NET 10 use the HTTP feed.
|
|
|
|
|
ARG NUGET_INDEX=https://mirror.soroushasadi.com/repository/nuget-group/index.json
|
|
|
|
|
RUN printf '%s\n' \
|
|
|
|
|
'<?xml version="1.0" encoding="utf-8"?>' \
|
|
|
|
|
'<configuration>' \
|
|
|
|
|
' <packageSources>' \
|
|
|
|
|
' <clear />' \
|
|
|
|
|
" <add key=\"nexus\" value=\"${NUGET_INDEX}\" protocolVersion=\"3\" allowInsecureConnections=\"true\" />" \
|
|
|
|
|
' </packageSources>' \
|
|
|
|
|
' <config>' \
|
|
|
|
|
' <add key="http_retry_count" value="8" />' \
|
|
|
|
|
' <add key="http_retry_delay_milliseconds" value="1000" />' \
|
|
|
|
|
' </config>' \
|
|
|
|
|
'</configuration>' > /tmp/nuget.config
|
2026-06-04 19:09:31 +03:30
|
|
|
COPY Directory.Build.props ./
|
|
|
|
|
COPY src/ ./src/
|
|
|
|
|
RUN dotnet restore src/Hokm.Server/Hokm.Server.csproj --configfile /tmp/nuget.config
|
|
|
|
|
RUN dotnet publish src/Hokm.Server/Hokm.Server.csproj -c Release -o /out --no-restore
|
|
|
|
|
|
|
|
|
|
FROM mirror.soroushasadi.com/dotnet/aspnet:10.0
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
# aspnet image ships no wget/curl — borrow busybox so the healthcheck has wget.
|
|
|
|
|
COPY --from=mirror.soroushasadi.com/busybox:1.36 /bin/busybox /usr/bin/wget
|
|
|
|
|
COPY --from=build /out ./
|
2026-06-04 19:59:27 +03:30
|
|
|
# Bind all interfaces. appsettings.json pins "Urls=http://localhost:5005" (dev),
|
|
|
|
|
# which wins over ASPNETCORE_URLS — so force 0.0.0.0 via command-line args, which
|
|
|
|
|
# have the highest config precedence. Otherwise the server is loopback-only inside
|
|
|
|
|
# the container and the published port returns "empty reply".
|
2026-06-04 19:09:31 +03:30
|
|
|
EXPOSE 5005
|
|
|
|
|
HEALTHCHECK --interval=10s --timeout=5s --retries=12 --start-period=20s \
|
|
|
|
|
CMD wget -q -O- http://127.0.0.1:5005/ || exit 1
|
2026-06-04 19:59:27 +03:30
|
|
|
ENTRYPOINT ["dotnet", "Hokm.Server.dll", "--urls", "http://0.0.0.0:5005"]
|