d1-04-db-config
Installation
SKILL.md
Day 1 · Step 4 — Configure the DB connection (no redeploy)
cd up-api
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL
dotnet add package Microsoft.EntityFrameworkCore.Design
appsettings.Development.json:
{
"ConnectionStrings": {
"Default": "Host=localhost;Port=5432;Database=up_db;Username=upadmin;Password=uppass"
}
}
Use localhost here because EF CLI commands (next steps) run from the host. Inside the up-api
container the connection string instead uses the compose service name db — that's already set in the
container's environment from the docker-deploy step, don't change it.