services:
  magic-redis:
    container_name: magic-redis
    image: redis:7-alpine
    restart: unless-stopped

  magic-postgres:
    image: postgres:16-alpine
    container_name: magic-postgres
    restart: unless-stopped
    ports:
      - 5432:5432
    environment:
      POSTGRES_USER: magic
      POSTGRES_DB: magic
      POSTGRES_PASSWORD: magic
    volumes:
      - 'magic_postgres_data:/var/lib/postgresql/data'

  magic-keycloak:
    image: quay.io/keycloak/keycloak:25.0.6
    container_name: magic-keycloak
    restart: unless-stopped
    command: start-dev
    ports:
      - 8080:8080
    environment:
      KEYCLOAK_ADMIN: admin
      KEYCLOAK_ADMIN_PASSWORD: admin

  magic-app:
    image: node:20-alpine3.19
    container_name: magic-app
    restart: unless-stopped
    working_dir: /app
    command: sh -c 'apk add --no-cache libc6-compat && npm i && npm run dev'
    ports:
      - 3000:3000
    volumes:
      - '.:/app'

volumes:
  btcpay_datadir:
  btcpay_pluginsdir:
  xmr_wallet:
  xmr_data:
  tor_datadir:
  tor_torrcdir:
  tor_servicesdir:
  nbxplorer_datadir:
  btcpay_postgres_datadir:
  magic_postgres_data:
