[Local] Use free host ports for local stack (app 18080, db 5544)
CI/CD / CI · dotnet build (push) Successful in 48s
CI/CD / Deploy · hamkadr (push) Successful in 8s

8080/8088/5434 were occupied by other local containers; pick non-clashing ports and fix LOCAL.md encoding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-04 19:30:11 +03:30
parent 6f02b1a0e9
commit 02d635415b
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -9,7 +9,7 @@ production and does **not** send SMS.
docker compose -f docker-compose.local.yml up --build
```
Then open **http://localhost:8080**.
Then open **http://localhost:18080**.
First run takes a few minutes (pulls the .NET images, restores NuGet from the Liara mirror,
builds, then applies EF migrations + seeds demo data on startup).
@@ -39,7 +39,7 @@ instead of being texted:
## Inspect the database
Exposed on host port **5434** (so it won't clash with a dev DB on 5433):
Exposed on host port **5544** (5432/5433/5434 are used by other local containers):
```bash
docker exec -it hamkadr_local_db psql -U hamkadr -d hamkadr
@@ -53,6 +53,8 @@ docker compose -f docker-compose.local.yml down -v # stop + wipe the DB vo
```
## Notes
- Host ports: app **18080**, Postgres **5544** (chosen to avoid clashing with your other
local containers). Change them in `docker-compose.local.yml` if needed.
- If `mcr.microsoft.com` isn't reachable on your machine, edit `Dockerfile.local` and swap the
two `FROM mcr.microsoft.com/dotnet/...` lines for `mirror.soroushasadi.com/dotnet/...`.
- Same for the Postgres image (`postgres:16-alpine``mirror.soroushasadi.com/postgres:16-alpine`).
+2 -2
View File
@@ -20,7 +20,7 @@ services:
db:
condition: service_healthy
ports:
- "8080:8080"
- "18080:8080"
environment:
ASPNETCORE_ENVIRONMENT: "Development" # ← OTP on screen, demo data, no Kavenegar
ASPNETCORE_URLS: "http://+:8080"
@@ -37,7 +37,7 @@ services:
POSTGRES_USER: hamkadr
POSTGRES_PASSWORD: hamkadr_local
ports:
- "5434:5432" # exposed for inspection; 5434 avoids clashing with your dev DB on 5433
- "5544:5432" # exposed for inspection on host port 5544 (5432/5433/5434 already in use)
volumes:
- hamkadr_local_db:/var/lib/postgresql/data
healthcheck: