version: "3"

# (C) Jules Field <Jules@Zend.To> 2022 for ZendTo.
#
# Before you "docker compose up" or "docker compose build" from this,
# see below to set the args
#     ZENDTO_VERSION (if you don't want the latest production release)
#     TZ             (if you don't want the UTC timezone)
# Just leave either/both of them blank to use the defaults.

name: "ZendTo"

services:

  zendto:
    image: julesfm/zendto
    container_name: ZendTo
    build:
      context: ./docker
      args:
        ZENDTO_VERSION: latest
        TZ: America/New_York
    env_file: docker/env
    ports:
      - "80:80"
    working_dir: /root
    volumes:
        # Where main ZendTo config files exist
        # (preferences.php, zendto.conf, internaldomains.conf)
        # and all UI text in all languages (locale/*_*/*/*.po)
      - config:/opt/zendto/config
        # Where your users' uploaded files (big!) & DB are all held
      - data:/var/zendto/shared
        # Where UI templates live (better to edit translation strings
        # under config/locale instead, see zend.to/translators)
      - templates:/opt/zendto/templates
        # For email-logo.png
      - email-image:/opt/zendto/www/images/email
        # For local.css
      - css:/opt/zendto/www/css
        # Don't bother with this unless you're using
        # SAML login system (e.g. Azure, Shibboleth, Yubikey).
        # You'll know if you are. See zend.to/saml
      - config-saml:/opt/zendto/simplesamlphp/config
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 5m
    init: true

volumes:
  config:
  config-saml:
  templates:
  email-image:
  css:
  data:
    # SMB/CIFS example of a remote ZendTo data volume
    # UNC is \\files.example.com\ZendTo-Store
    # Connection is made as user "jules" with password "SECRET"
    # driver_opts:
    #   type: cifs
    #   # uid,gid 33 === www-data (Apache user,group)
    #   o: "addr=files.example.com,username=jules,password=SECRET,uid=33,gid=33,file_mode=0664,dir_mode=0775,rw"
    #   device: "//files.example.com/ZendTo-Store"
    #
    # NFS example of a remote ZendTo data volume
    # NFS server is nfs-server.example.com
    # Path on server is /volume1/homes/jkf/Docker
    # driver_opts:
    #   type: nfs
    #   o: "addr=nfs-server.example.com,nolock,soft,rw"
    #   device: ":/volume1/homes/jkf/Docker"
