Independent FastAPI backend for Maskan CRM. Owns contacts, organizations, leads, pipelines, activities, products, quotes, users, permissions, audit records and first-party integration credentials, with Alembic migrations against PostgreSQL. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: ${DB_NAME:-maskan_crm}
|
|
POSTGRES_USER: ${DB_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
|
|
ports:
|
|
- "${POSTGRES_PUBLIC_PORT:-5433}:5432"
|
|
volumes:
|
|
- maskan-crm-postgres:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-maskan_crm}",
|
|
]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
restart: unless-stopped
|
|
environment:
|
|
MASKAN_CRM_ENV: ${MASKAN_CRM_ENV:-development}
|
|
MASKAN_CRM_MODE: ${MASKAN_CRM_MODE:-standalone}
|
|
MASKAN_CRM_CORS_ORIGINS: ${MASKAN_CRM_CORS_ORIGINS:-http://127.0.0.1:5174,http://localhost:5174}
|
|
MASKAN_CRM_JWT_SECRET: ${MASKAN_CRM_JWT_SECRET:-local-development-secret-change-me-123456789}
|
|
MASKAN_CRM_ACCESS_TOKEN_MINUTES: ${MASKAN_CRM_ACCESS_TOKEN_MINUTES:-30}
|
|
DB_HOST: postgres
|
|
DB_PORT: 5432
|
|
DB_NAME: ${DB_NAME:-maskan_crm}
|
|
DB_USER: ${DB_USER:-postgres}
|
|
DB_PASSWORD: ${DB_PASSWORD:-postgres}
|
|
DB_SSLMODE: disable
|
|
MASKAN_CRM_BOOTSTRAP_WORKSPACE: ${MASKAN_CRM_BOOTSTRAP_WORKSPACE:-maskan}
|
|
MASKAN_CRM_BOOTSTRAP_COMPANY: ${MASKAN_CRM_BOOTSTRAP_COMPANY:-Maskan Technologies}
|
|
MASKAN_CRM_BOOTSTRAP_ADMIN_EMAIL: ${MASKAN_CRM_BOOTSTRAP_ADMIN_EMAIL:-owner@example.com}
|
|
MASKAN_CRM_BOOTSTRAP_ADMIN_PASSWORD: ${MASKAN_CRM_BOOTSTRAP_ADMIN_PASSWORD:-change-this-before-first-run}
|
|
MASKAN_CRM_SEED_DEMO: ${MASKAN_CRM_SEED_DEMO:-true}
|
|
command:
|
|
[
|
|
"sh",
|
|
"-c",
|
|
"alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8091",
|
|
]
|
|
ports:
|
|
- "${MASKAN_CRM_API_PORT:-8091}:8091"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD",
|
|
"python",
|
|
"-c",
|
|
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8091/health/ready')",
|
|
]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 12
|
|
|
|
volumes:
|
|
maskan-crm-postgres:
|