version: '2.2'

services:
  unifi:
    build:
      context: .
      dockerfile: Dockerfile
    image: "${CI_REGISTRY_IMAGE:-jcberthon/unifi}:${IMAGE_TAG:-latest}"
    restart: always
    hostname: 'unifi'
    container_name: unifi
    mem_limit: 1024m
    memswap_limit: 1536m
    init: true
    cap_drop:
      - ALL
    ports:
      - '6789:6789'
      - '8080:8080'
      - '8443:8443'
      - '8843:8843'
      - '10001:10001/udp'
    volumes:
      - unifi_data:/var/lib/unifi
      - unifi_logs:/var/log/unifi

volumes:
  unifi_data:
    driver: local
  unifi_logs:
    driver: local

version: '2.1'

services:
  unifi:
    build:
      context: .
      dockerfile: Dockerfile
    image: "${CI_REGISTRY_IMAGE:-jcberthon/unifi}:${IMAGE_TAG:-latest}"
    restart: always
    hostname: 'unifi'
    container_name: unifi
    mem_limit: 1024m
    memswap_limit: 1536m
    cap_drop:
      - ALL
    ports:
      - '6789:6789'
      - '8080:8080'
      - '8443:8443'
      - '8843:8843'
      - '10001:10001/udp'
    volumes:
      - unifi_data:/var/lib/unifi
      - unifi_logs:/var/log/unifi

volumes:
  unifi_data:
    driver: local
  unifi_logs:
    driver: local

Remove init option, revert to version 2.1
Remove init option, revert to version 2.1

The version 2.2 was only required to have the init option. As we removed
it, we can broaden the compatibility of this compose file.
