- Gitea Actions workflow: build sor-host + sor-admin, push to Harbor, auto-update image tags in k8s manifests (GitOps — ArgoCD watches deploy/k8s/) - Dockerfile.host / Dockerfile.admin: multi-stage .NET 8 builds, non-root runtime - deploy/k8s/: configmap, deployments, services, nginx ingress - hub.aeternalisgames.com → sor-host (WebSocket gateway) - admin.aeternalisgames.com → sor-admin (Blazor admin portal) - hub-tls for hub, cert-manager auto-provisions admin-tls - deploy/secrets/: README + *.yaml.template files to populate (gitignored) - deploy/argo/application.yaml: ArgoCD Application (namespace stone-server) - Root .gitignore: excludes deploy/secrets/*.yaml (never commit populated secrets) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
37 lines
1.3 KiB
Docker
37 lines
1.3 KiB
Docker
# ── Stage 1: Build ────────────────────────────────────────────────────────────
|
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
WORKDIR /src
|
|
|
|
COPY Directory.Build.props Directory.Packages.props ./
|
|
COPY SOR.slnx ./
|
|
|
|
# SOR.Admin only depends on Cdn, Database, and Shared.
|
|
COPY src/SOR.Admin/SOR.Admin.csproj src/SOR.Admin/
|
|
COPY src/SOR.Cdn/SOR.Cdn.csproj src/SOR.Cdn/
|
|
COPY src/SOR.Database/SOR.Database.csproj src/SOR.Database/
|
|
COPY src/SOR.Shared/SOR.Shared.csproj src/SOR.Shared/
|
|
|
|
RUN dotnet restore src/SOR.Admin/SOR.Admin.csproj
|
|
|
|
# Copy full source (needed for migrations embedded in SOR.Database).
|
|
COPY . .
|
|
RUN dotnet publish src/SOR.Admin/SOR.Admin.csproj \
|
|
-c Release \
|
|
--no-restore \
|
|
-o /app/publish
|
|
|
|
# ── Stage 2: Runtime ──────────────────────────────────────────────────────────
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
|
WORKDIR /app
|
|
|
|
RUN adduser --disabled-password --gecos "" appuser
|
|
USER appuser
|
|
|
|
COPY --from=build --chown=appuser:appuser /app/publish .
|
|
|
|
EXPOSE 8080
|
|
ENV ASPNETCORE_URLS=http://+:8080
|
|
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
|
|
ENTRYPOINT ["dotnet", "SOR.Admin.dll"]
|