#!/usr/bin/env docker compose -f
name: backstage
services:
  psql:
    image: postgres:17.9
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    ports:
      - '5432:5432'
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready']
      interval: 10s
      retries: 5
      start_period: 30s
      timeout: 10s
  redis:
    image: redis:8.2.1-alpine
    ports:
      - '6379:6379'
    healthcheck:
      test: ['CMD-SHELL', 'redis-cli ping | grep PONG']
      interval: 1s
      timeout: 3s
      retries: 5
  opensearch:
    image: opensearchproject/opensearch:2.19.5
    environment:
      plugins.security.disabled: true
      discovery.type: single-node
      OPENSEARCH_INITIAL_ADMIN_PASSWORD: Opensearch1!
    ports:
      - '9200:9200'
      - '9600:9600'
    healthcheck:
      test: 'curl --fail opensearch:9200/_cat/health >/dev/null || exit 1'
      interval: 5s
      timeout: 5s
      retries: 30
