services:
  onec-adapter:
    build:
      context: ..
      dockerfile: connector/Dockerfile
    image: onec-adapter-connector:0.1.0
    env_file:
      - .env
    ports:
      - "${ONEC_ADAPTER_PORT:-8011}:8011"
    volumes:
      - onec-adapter-data:/data
    restart: unless-stopped
    healthcheck:
      test:
        - CMD
        - python
        - -c
        - "import json, urllib.request; print(json.load(urllib.request.urlopen('http://127.0.0.1:8011/health', timeout=5)).get('status'))"
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s

volumes:
  onec-adapter-data:
