# SPDX-License-Identifier: GPL-2.0-only # Project: AstraDesk # File: docker-compose.yml # Website: https://www.astradesk.dev # Repository: https://github.com/SSobol77/astradesk # # Description: Configures the associated AstraDesk component or deployment. # # Copyright (c) 2026 Siergej Sobolewski # # This file is part of AstraDesk. # # AstraDesk is licensed under the GNU General Public License version 2 only. # See the LICENSE file in the project root for the full license text. services: api: build: . env_file: - path: .env required: false environment: UV_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cu121" UV_INDEX_STRATEGY: "unsafe-best-match" ADMIN_API_URL: http://admin_api:8001 ports: - "8080:8080" depends_on: db: condition: service_healthy redis: condition: service_healthy nats: condition: service_healthy ticket-adapter: condition: service_started prometheus: condition: service_healthy mcp: condition: service_started # ----- НОВЫЙ сервис ----- admin_api: build: context: . dockerfile: services/admin_api/Dockerfile env_file: - path: .env required: false ports: - "8001:8001" volumes: # NOTE: admin_api resolves its packages dir as `parents[2]` of main.py, # i.e. /app/packages (see services/admin_api/src/astradesk_admin/main.py # and services/admin_api/Dockerfile) — must match the image layout. - ./packages:/app/packages:ro restart: unless-stopped prometheus: # prom/prometheus:v3.7.1 (pinned by digest; matches dev compose baseline) image: prom/prometheus@sha256:ff7e389acbe064a4823212a500393d40a28a8f362e4b05cbf6742a9a3ef736b2 ports: - "9090:9090" volumes: - ./dev/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro command: - "--config.file=/etc/prometheus/prometheus.yml" healthcheck: test: ["CMD", "wget", "--spider", "-q", "http://localhost:9090/-/ready"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped ticket-adapter: build: services/ticket-adapter-java env_file: - path: .env required: false ports: - "8082:8081" depends_on: mysql: condition: service_healthy admin: build: services/admin-portal env_file: - path: .env required: false ports: - "3000:3000" depends_on: api: condition: service_started auditor: build: ./services/auditor env_file: - path: .env required: false depends_on: nats: condition: service_healthy restart: unless-stopped mcp: build: mcp env_file: - path: .env required: false ports: - "8002:8000" depends_on: redis: condition: service_healthy # kb-service/jira-service are opt-in stub placeholders (profile # "no-start", disabled by default). `required: false` lets Compose # validate and start mcp without them present (INV-BUILD-4/8) — # mcp's clients (mcp/src/clients/{kb,jira}_client.py) already handle # the backing service being unreachable. kb-service: condition: service_started required: false jira-service: condition: service_started required: false environment: - REDIS_URL=redis://redis:6379/0 - KB_SERVICE_URL=http://kb-service:8000 - JIRA_SERVICE_URL=http://jira-service:8000 # Opt-in stub backends for local wiring/testing only (`docker compose # --profile no-start up`); not started by default. Pinned digest instead of # `alpine:latest` per INV-BUILD-5. kb-service: image: alpine@sha256:48b0309ca019d89d40f670aa1bc06e426dc0931948452e8491e3d65087abc07d command: ["sleep", "3600"] profiles: ["no-start"] jira-service: image: alpine@sha256:48b0309ca019d89d40f670aa1bc06e426dc0931948452e8491e3d65087abc07d command: ["sleep", "3600"] profiles: ["no-start"] db: # pgvector/pgvector:pg18 (pinned by digest; matches dev compose baseline) image: pgvector/pgvector@sha256:212765b63c1462883de295c4c415edcd22191b8d8d46853e86ad05d4b577a4cb environment: POSTGRES_DB: astradesk POSTGRES_USER: astradesk POSTGRES_PASSWORD: astrapass ports: ["5432:5432"] volumes: # pg18+ images store data under a version-specific subdirectory of # /var/lib/postgresql itself (pg_ctlcluster-compatible layout) — mounting # at the old .../data path leaves the volume "unused" and the container # exits at startup. See https://github.com/docker-library/postgres/pull/1259. - postgres_data:/var/lib/postgresql # Clean-volume bootstrap: postgres runs *.sql here once on first init # (INV-BUILD-5 clean-volume migration path), matching docker-compose.dev.yml. - ./migrations:/docker-entrypoint-initdb.d:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U astradesk"] interval: 5s timeout: 5s retries: 5 mysql: # mysql:8 (pinned by digest) image: mysql@sha256:d36d39a64cd12a5c1cc9e6aa2bfb5f8d4c81a2f6586e0a04a9ae13939db02209 environment: MYSQL_DATABASE: tickets MYSQL_USER: tickets MYSQL_PASSWORD: tickets MYSQL_ROOT_PASSWORD: root ports: - "3306:3306" volumes: - mysql_data:/var/lib/mysql healthcheck: test: ["CMD", "mysqladmin", "ping","-h", "localhost", "-u", "tickets", "-ptickets"] interval: 5s timeout: 5s retries: 5 redis: # redis:8.2.2 (pinned by digest; matches dev compose baseline) image: redis@sha256:4521b581dbddea6e7d81f8fe95ede93f5648aaa66a9dacd581611bf6fe7527bd ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 nats: # nats:2.12.1-alpine (pinned by digest; matches dev compose baseline) image: nats@sha256:b3f2bd84176ae7bd0afa9c48a00f06d7d0818ff4aaee898e4172e0b8340e5816 command: - "--jetstream" - "--store_dir=/datastore" - "-m" - "8222" ports: - "4222:4222" - "8222:8222" volumes: - nats_data:/datastore healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8222/healthz"] interval: 10s timeout: 5s retries: 5 start_period: 10s domain-support: build: packages/domain-support depends_on: - api - nats environment: API_URL: http://api:8000/api/admin/v1 API_TOKEN: "${API_TOKEN:-}" domain-finance: build: packages/domain-finance depends_on: - api environment: API_URL: http://api:8000/api/admin/v1 API_TOKEN: "${API_TOKEN:-}" domain-finance-java: build: packages/domain-finance command: java -jar build/libs/domain-finance.jar depends_on: - api environment: API_URL: http://api:8000/api/admin/v1 API_TOKEN: "${API_TOKEN:-}" domain-finance-grpc: build: packages/domain-finance ports: - "50051:50051" depends_on: - api environment: API_URL: http://api:8000/api/admin/v1 API_TOKEN: "${API_TOKEN:-}" domain-supply: build: packages/domain-supply depends_on: - api environment: API_URL: http://api:8000/api/admin/v1 API_TOKEN: "${API_TOKEN:-}" domain-supply-java: build: packages/domain-supply command: java -jar build/libs/domain-supply.jar depends_on: - api environment: API_URL: http://api:8000/api/admin/v1 API_TOKEN: "${API_TOKEN:-}" domain-supply-grpc: build: packages/domain-supply ports: - "50052:50051" depends_on: - api environment: API_URL: http://api:8000/api/admin/v1 API_TOKEN: "${API_TOKEN:-}" volumes: postgres_data: mysql_data: redis_data: nats_data: