.github/workflows/ci.yml — on push/PR:
- backend job: dotnet restore/build/test with a live postgres service
- web job: pnpm install + vite build + tsc, uploads dist artifact
- pos job: windows-latest, dotnet publish self-contained win-x64
single-file exe as artifact
.github/workflows/docker.yml — on push to main (if src changed) or manual:
- api image → ghcr.io/nurdotnet/food-market-api:{latest,sha}
- web image → ghcr.io/nurdotnet/food-market-web:{latest,sha}
- uses buildx + GHA cache
deploy/Dockerfile.api — multi-stage (.NET 8 sdk → aspnet runtime),
healthcheck on /health, App_Data + logs volumes mounted.
deploy/Dockerfile.web — node20 build → nginx 1.27 runtime; ships the
Vite dist + nginx.conf that proxies /api, /connect, /health to api
service and serves the SPA with fallback to index.html.
deploy/nginx.conf — SPA + API reverse-proxy configuration.
deploy/docker-compose.yml — production-shape stack: postgres 16 +
api (from ghcr image) + web (from ghcr image), named volumes, env-
driven tags so stage/prod can pin specific SHAs.
deploy/backup.sh — pg_dump wrapper with 3 modes: local (brew
postgres), --docker (compose container), --remote HOST:PORT. Writes
gzipped dumps to ~/food-market-backups, 30-day retention.
docs/24x7.md — explains where Claude/CI/stage live, which pieces
depend on the Mac, and the exact steps to hand off secrets via
~/.food-market-secrets/ so I can push them into GitHub Secrets.
Next, once user supplies Proxmox + FTP + Telegram creds: stage deploy
workflow, notification workflow, and (optional) claude-runner VM so
I no longer depend on the Mac being awake.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
36 lines
1.4 KiB
Docker
36 lines
1.4 KiB
Docker
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
WORKDIR /src
|
|
|
|
COPY food-market.sln global.json Directory.Build.props Directory.Packages.props ./
|
|
COPY src/food-market.domain/food-market.domain.csproj src/food-market.domain/
|
|
COPY src/food-market.shared/food-market.shared.csproj src/food-market.shared/
|
|
COPY src/food-market.application/food-market.application.csproj src/food-market.application/
|
|
COPY src/food-market.infrastructure/food-market.infrastructure.csproj src/food-market.infrastructure/
|
|
COPY src/food-market.api/food-market.api.csproj src/food-market.api/
|
|
COPY src/food-market.pos.core/food-market.pos.core.csproj src/food-market.pos.core/
|
|
COPY src/food-market.pos/food-market.pos.csproj src/food-market.pos/
|
|
|
|
RUN dotnet restore src/food-market.api/food-market.api.csproj
|
|
|
|
COPY src/ src/
|
|
RUN dotnet publish src/food-market.api/food-market.api.csproj -c Release -o /app --no-restore
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=build /app .
|
|
|
|
ENV ASPNETCORE_URLS=http://+:8080
|
|
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
ENV DOTNET_NOLOGO=1
|
|
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
|
|
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s \
|
|
CMD curl -fsS http://localhost:8080/health || exit 1
|
|
|
|
ENTRYPOINT ["dotnet", "foodmarket.Api.dll"]
|