networks:
  DOCKER_NETWORK_DATA: #LIBREPORTAL|DOCKER_NETWORK_TAG|DOCKER_NETWORK_DATA
    external: true

services:
  onlyoffice-service: #LIBREPORTAL|SERVICE_TAG_1|onlyoffice-service
    container_name: onlyoffice-service
    image: onlyoffice/documentserver:latest
    restart: unless-stopped
    hostname: onlyoffice
    stdin_open: true
    tty: true
    # GLUETUN_OFF_BEGIN
    ports:
      - "PORTS_DATA_1" #LIBREPORTAL|PORTS_TAG_1|PORTS_DATA_1
    # GLUETUN_OFF_END
    labels:
      libreportal.category: "CATEGORY_DATA" #LIBREPORTAL|CATEGORY_TAG|CATEGORY_DATA
      libreportal.title: "TITLE_DATA" #LIBREPORTAL|TITLE_TAG|TITLE_DATA
      traefik.enable: TRAEFIK_ENABLE_DATA #LIBREPORTAL|TRAEFIK_ENABLE_TAG|TRAEFIK_ENABLE_DATA
      # TRAEFIK_PORT_1_BEGIN
      traefik.http.routers.onlyoffice-service.entrypoints: web,websecure
      traefik.http.routers.onlyoffice-service.rule: Host(`DOMAINSUBNAME_DATA_1`) #LIBREPORTAL|DOMAINSUBNAME_TAG_1|DOMAINSUBNAME_DATA_1
      traefik.http.routers.onlyoffice-service.tls: true
      traefik.http.routers.onlyoffice-service.tls.certresolver: production
      traefik.http.services.onlyoffice-service.loadbalancer.server.port: PORT_INTERNAL_DATA_1 #LIBREPORTAL|PORT_INTERNAL_TAG_1|PORT_INTERNAL_DATA_1
      traefik.http.routers.onlyoffice-service.middlewares: MIDDLEWARE_DATA_1 #LIBREPORTAL|MIDDLEWARE_TAG_1|MIDDLEWARE_DATA_1
      # Headers for onlyoffice, https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/151
      traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.X-Forwarded-Proto: https
      traefik.http.middlewares.onlyoffice-headers.headers.accesscontrolalloworiginlist: "*"
      # TRAEFIK_PORT_1_END
    healthcheck:
      disable: HEALTHCHECK_DATA #LIBREPORTAL|HEALTHCHECK_TAG|HEALTHCHECK_DATA
    volumes:
      - SOCKET_DATA #LIBREPORTAL|SOCKET_TAG|SOCKET_DATA
      - "./document_data:/var/www/onlyoffice/Data"
      - "./document_log:/var/log/onlyoffice"
    # GLUETUN_OFF_BEGIN
    networks:
      DOCKER_NETWORK_DATA: #LIBREPORTAL|DOCKER_NETWORK_TAG|DOCKER_NETWORK_DATA
        ipv4_address: IP_DATA_1 #LIBREPORTAL|IP_TAG_1|IP_DATA_1
    # GLUETUN_OFF_END
    # GLUETUN_ON_BEGIN
    # network_mode: "container:gluetun-service"
    # GLUETUN_ON_END
