From 02d635415b1a4196e3334f7c0a654610bcdc6da7 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Thu, 4 Jun 2026 19:30:11 +0330 Subject: [PATCH] [Local] Use free host ports for local stack (app 18080, db 5544) 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 --- LOCAL.md | 6 ++++-- docker-compose.local.yml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/LOCAL.md b/LOCAL.md index 00a6d24..5ff0357 100644 --- a/LOCAL.md +++ b/LOCAL.md @@ -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`). diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 52059b4..64460ec 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -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: