02d635415b
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>
2.6 KiB
2.6 KiB
Run همکادر locally with Docker (for testing)
A self-contained stack — app built from source + its own Postgres. It does not touch production and does not send SMS.
Start
docker compose -f docker-compose.local.yml up --build
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).
Log in (OTP shown on screen — no SMS)
Because it runs in the Development environment, the login code is printed on the page instead of being texted:
- Go to ورود / ثبتنام, choose کادر درمان, enter
09120000000(the admin phone). - Press دریافت کد تأیید → the 5-digit code appears in a green box on the page.
- Enter it → you're in as admin (you'll see پنل مدیریت / تنظیمات in the nav).
Kavenegar is never called in Development, even if SMS is toggled on.
Test ingestion
- Go to پنل مدیریت → تنظیمات → منابع جمعآوری.
- Enable a source and fill its config, e.g. مدجابز (medjobs.ir) or تلگرام (channel
usernames). For Telegram from inside Iran you'll need the proxy — tick «از پروکسی استفاده شود»
under that source and set the proxy address (see
deploy/xray/README.md); locally you can run your own Xray and point it atsocks5://host.docker.internal:PORT. - Save, then trigger a run from پنل مدیریت → صف آگهیها (Run-now), or set «اجرای خودکار» with a short interval.
- Watch logs:
docker compose -f docker-compose.local.yml logs -f appNew items land in the review queue (Manual mode) or publish (Automatic mode).
Inspect the database
Exposed on host port 5544 (5432/5433/5434 are used by other local containers):
docker exec -it hamkadr_local_db psql -U hamkadr -d hamkadr
Stop / reset
docker compose -f docker-compose.local.yml down # stop (keeps data)
docker compose -f docker-compose.local.yml down -v # stop + wipe the DB volume
Notes
- Host ports: app 18080, Postgres 5544 (chosen to avoid clashing with your other
local containers). Change them in
docker-compose.local.ymlif needed. - If
mcr.microsoft.comisn't reachable on your machine, editDockerfile.localand swap the twoFROM mcr.microsoft.com/dotnet/...lines formirror.soroushasadi.com/dotnet/.... - Same for the Postgres image (
postgres:16-alpine→mirror.soroushasadi.com/postgres:16-alpine).