Fix category shadow foreign keys and .NET 10 Docker build context
Build MoneyMap image / build-and-push (push) Failing after 7s

This commit is contained in:
aj
2026-09-12 17:38:38 -04:00
parent 08e54a4d31
commit df09dd8d53
6 changed files with 133 additions and 4 deletions
+28
View File
@@ -1801,6 +1801,34 @@ var importer = new TransactionImporter(mockDb.Object, mockCardResolver.Object);
## Deployment
### Docker image build (.NET 10)
Run from the repository root (not `MoneyMap/`):
```bash
docker build -f MoneyMap/Dockerfile -t moneymap:local .
```
The Dockerfile uses the .NET 10 SDK and ASP.NET Core 10 runtime. The root
context is required to copy `MoneyMap.sln` and the shared `MoneyMap.Core`
project. The root `.dockerignore` excludes local build output, receipts,
database files, and all `appsettings*.json`/credential files. Supply runtime
configuration separately via environment variables (for example
`ConnectionStrings__MoneyMapDb`, `OPENAI_API_KEY`) or a mounted
configuration file; credentials are not baked into the image. Building does
not start the application or apply migrations.
### Category relationship mapping
`Transaction.Category` and `CategoryMapping.Category` remain string category
names. The corresponding collections on `Category` are `[NotMapped]` so EF
cannot infer nonexistent `CategoryId` shadow foreign keys. The real
`RecurringPlace.CategoryId` and parent/child category relationships remain
mapped. This is a model correction only, with no database schema change or
migration required. SQL Server model/query regression tests compile both
receipt duplicate-check queries without connecting to a database.
### Database Migration
```bash
# Create migration