networks:
  proxy:
    external: true


services:

###################
## Stack Appflowy
###################

  kimai-db:
    image: mysql:latest
    container_name: kimai-db
    hostname: kimai-db
    restart: unless-stopped
    volumes:
      - ${CONFIG_DIR}/kimai/mysql:/var/lib/mysql
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - MYSQL_DATABASE=kimai
      - MYSQL_USER=kimai
      - MYSQL_PASSWORD=yCcaB0gaTZWYpvc1Zc6y5PYoaUjh
      - MYSQL_ROOT_PASSWORD=4ylYsQTLEBxqWuIliqGHnU8A5PIf
    command: --default-storage-engine innodb
    healthcheck:
      test: mysqladmin -p$$MYSQL_ROOT_PASSWORD ping -h localhost
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3
    networks:
      - proxy

  kimai:
    image: kimai/kimai2:apache
    container_name: kimai
    hostname: kimai
    restart: unless-stopped
    ports:
      - 8001:8001
    volumes:
      - ${CONFIG_DIR}/kimai/data:/opt/kimai/var/data
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - ADMINMAIL=julien.albergne@gmail.com
      - ADMINPASS=KHWyIrH4yymVf4OGRK6U3yq3VWDg
      - DATABASE_URL=mysql://kimai:yCcaB0gaTZWYpvc1Zc6y5PYoaUjh@kimai-db/kimai
      - TRUSTED_HOSTS=kimai.jujub.eu|localhost|127.0.0.1
    networks:
      - proxy
