version: '2.1'

services:
  unifi:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        BASEIMG: ${ARG_BASEIMG:-openjdk}
        BASEVERS: ${ARG_BASEVERS:-8-jre-slim}
        ARCH: ${ARG_ARCH:-amd64}
    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:
      - '3478:3478/udp'
      - '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.2'

services:
  unifi:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        BASEIMG: ${ARG_BASEIMG:-openjdk}
        BASEVERS: ${ARG_BASEVERS:-8-jre-slim}
        ARCH: ${ARG_ARCH:-amd64}
    image: "${CI_REGISTRY_IMAGE:-jcberthon/unifi}:${IMAGE_TAG:-latest}"
    restart: always
    hostname: 'unifi'
    container_name: unifi
    cpus: 1.0
    mem_limit: 1024m
    memswap_limit: 1536m
    cap_drop:
      - ALL
    ports:
      - '3478:3478/udp'
      - '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

Add cpu limits (require compose format 2.2)
Add cpu limits (require compose format 2.2)
