feat(pm): add pm-api/pm-frontend services to the ERP stack (serves /pm for the PM panel)
PM joins the ERP traefik (PathPrefix /pm, priority 100), shares the ERP database (additive tables at startup), and reads ERP panels for SSO. PIP_INDEX_URL build arg mirrors the api/bot images.
This commit is contained in:
@@ -350,6 +350,78 @@ services:
|
||||
restart: unless-stopped
|
||||
mem_limit: 512m
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# PM platform (vendored from Aramesh/PM under ./pm) — serves the /panel/pm
|
||||
# iframe at /pm/ on this domain. Shares the ERP database (its tables are
|
||||
# created additively at startup) and reads ERP users/user_panels for SSO.
|
||||
# ---------------------------------------------------------------------------
|
||||
pm-api:
|
||||
image: v15-pm-api:latest
|
||||
build:
|
||||
context: ./pm/backend
|
||||
dockerfile: Dockerfile
|
||||
container_name: pm-api
|
||||
|
||||
volumes:
|
||||
- pm_files:/data/files
|
||||
- ./pm/backend/app:/srv/pm/app
|
||||
|
||||
environment:
|
||||
# Same database as the ERP — PM tables are additive, created at startup.
|
||||
PM_DATABASE_URL: postgresql+asyncpg://postgres:${POSTGRES_PASSWORD:-postgres}@postgres:5432/procurement
|
||||
PM_SESSION_SECRET: ${PM_SESSION_SECRET:-12278fc281bd0e22950e76364e1a18cea61fbc6a24604fdd79690a817ec36ac8}
|
||||
PM_ADMIN_USER: ${PM_ADMIN_USER:-admin}
|
||||
PM_ADMIN_PASSWORD: ${PM_ADMIN_PASSWORD:-pm123456}
|
||||
PM_FILES_DIR: /data/files
|
||||
PM_DEV_ROLE_SWITCH: ${PM_DEV_ROLE_SWITCH:-false}
|
||||
# ERP integration — in-network service URLs.
|
||||
PM_ERP_BASE_URL: http://api:8000
|
||||
PM_ERP_CASDOOR_ENDPOINT: http://casdoor:8000
|
||||
PM_ERP_CASDOOR_CLIENT_ID: ${PM_ERP_CASDOOR_CLIENT_ID:-inventory-app-client}
|
||||
PM_ERP_CASDOOR_CLIENT_SECRET: ${PM_ERP_CASDOOR_CLIENT_SECRET:-inventory-app-secret-2026}
|
||||
PM_ERP_SERVICE_USERNAME: ${PM_ERP_SERVICE_USERNAME:-pm-service}
|
||||
PM_ERP_SERVICE_PASSWORD: ${PM_ERP_SERVICE_PASSWORD:-pm-service-2026}
|
||||
PM_CASDOOR_ISSUER: ${CASDOOR_ISSUER:-http://localhost:8080}
|
||||
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
api:
|
||||
condition: service_started
|
||||
|
||||
networks:
|
||||
- default
|
||||
|
||||
restart: unless-stopped
|
||||
mem_limit: 512m
|
||||
|
||||
pm-frontend:
|
||||
image: v15-pm-frontend:latest
|
||||
build:
|
||||
context: ./pm/frontend
|
||||
dockerfile: Dockerfile
|
||||
container_name: pm-frontend
|
||||
|
||||
depends_on:
|
||||
- pm-api
|
||||
|
||||
# PM platform under /pm on the same domain and the same Traefik router.
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.pm.rule=PathPrefix(`/pm`)
|
||||
- traefik.http.routers.pm.entrypoints=web
|
||||
# Higher priority than the ERP frontend Host router — otherwise /pm/api
|
||||
# would reach the ERP SPA (POST → 405).
|
||||
- traefik.http.routers.pm.priority=100
|
||||
- traefik.http.services.pm.loadbalancer.server.port=80
|
||||
|
||||
networks:
|
||||
- traefik_network
|
||||
- default
|
||||
|
||||
restart: unless-stopped
|
||||
mem_limit: 128m
|
||||
|
||||
networks:
|
||||
# شبکهی عمومی: فقط ترافیک و سرویسهای عمومی. postgres روی شبکهی
|
||||
# پیشفرض میماند و از بیرون قابل دسترسی نیست.
|
||||
@@ -366,3 +438,4 @@ volumes:
|
||||
postgres_data:
|
||||
minio_data:
|
||||
traefik_certs:
|
||||
pm_files:
|
||||
|
||||
Reference in New Issue
Block a user