6f02b1a0e9
Add docker-compose.local.yml + Dockerfile.local (public MS images + Liara NuGet) to run the whole app with a throwaway Postgres in one command for local testing, plus LOCAL.md. OtpService now never calls Kavenegar in the Development environment and always returns the code so the login page shows it on screen — guarantees local logins work with no SMS. Production behavior unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.4 KiB
2.4 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:8080.
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 5434 (so it won't clash with a dev DB on 5433):
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
- 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).