Files
hamkadr/docker-compose.yml
T
soroush.asadi 3c08c1a265
CI/CD / CI · dotnet build (push) Successful in 6m22s
CI/CD / Deploy · hamkadr (push) Failing after 3s
Move ingestion + Telegram/Bale/Divar config to DB-backed admin settings
- AppSetting gains source config: AutoIngestEnabled, IngestIntervalMinutes, Telegram/Bale/Divar enabled+channels/token/queries
- IListingSource.FetchAsync(AppSetting) — sources read config from DB, not IOptions/appsettings; sample source dev-only
- IngestionWorker reads AutoIngest+interval from DB each cycle (toggle at runtime, no redeploy)
- /Admin/Settings gets a 'منابع جمع‌آوری' section; removed Ingestion env/appsettings + compose env vars
- ENV_FILE shrinks to HOST_PORT + POSTGRES_* + ADMIN_PHONE (AI + sources are all in-admin); migration

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 00:44:11 +03:30

50 lines
2.1 KiB
YAML

# Production compose for hamkadr.ir — the Gitea deploy job uses THIS file directly
# (docker compose build api / up -d --no-deps api). Local dev DB → docker-compose.dev.yml.
# nginx (host) terminates TLS for hamkadr.ir and reverse-proxies to 127.0.0.1:${HOST_PORT}.
name: hamkadr # locked so redeploys reuse the same named volume (no orphaned data)
services:
# ── .NET 10 Razor Pages app ──────────────────────────────────────────────────
api:
image: mirror.soroushasadi.com/hamkadr/api:${API_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
container_name: hamkadr_api
restart: unless-stopped
depends_on:
db:
condition: service_healthy
ports:
- "127.0.0.1:${HOST_PORT:-8090}:8080" # localhost-only; nginx proxies hamkadr.ir → here
environment:
ASPNETCORE_ENVIRONMENT: "Production"
ASPNETCORE_URLS: "http://+:8080"
ConnectionStrings__Default: "Host=db;Port=5432;Database=${POSTGRES_DB:-hamkadr};Username=${POSTGRES_USER:-hamkadr};Password=${POSTGRES_PASSWORD}"
Auth__AdminPhone: "${ADMIN_PHONE:-}"
# Ingestion + AI + channel sources are configured at runtime in /Admin/Settings (DB), not here.
# healthcheck is defined in the Dockerfile (bash /dev/tcp probe) so the deploy
# job's `docker inspect Health.Status` wait works.
# ── PostgreSQL (internal only — never published) ─────────────────────────────
db:
image: mirror.soroushasadi.com/postgres:16-alpine
container_name: hamkadr_db
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-hamkadr}
POSTGRES_USER: ${POSTGRES_USER:-hamkadr}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- hamkadr_db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-hamkadr} -d ${POSTGRES_DB:-hamkadr}"]
interval: 5s
timeout: 5s
retries: 20
volumes:
hamkadr_db_data:
name: hamkadr_db_data