# https://github.com/tuxgasy/docker-dolibarr/blob/master/README.md

networks:
  DOCKERNETWORKHERE:
    external: true
  dolibarr:
    name: dolibarr
    internal: true

services:
  dolibarr:
    container_name: dolibarr
    image: tuxgasy/dolibarr:latest
    environment:
      - DOLI_DB_HOST=mysql
      - DOLI_DB_USER=dolibarr
      - DOLI_DB_PASSWORD=RANDOMIZEDPASSWORD1
      - DOLI_DB_NAME=dolibarr
      - DOLI_ADMIN_LOGIN=admin
      - DOLI_ADMIN_PASSWORD=RANDOMIZEDPASSWORD2
      - DOLI_URL_ROOT=https://DOMAINSUBNAMEHERE
    #labels:
      #traefik.enable: true
      #traefik.http.routers.dolibarr.entrypoints: web,websecure
      #traefik.http.routers.dolibarr.rule: Host(`DOMAINSUBNAMEHERE`)
      #traefik.http.routers.dolibarr.tls: true
      #traefik.http.routers.dolibarr.tls.certresolver: production
      #traefik.http.services.dolibarr.loadbalancer.server.port: 80
      #traefik.http.routers.dolibarr.middlewares:
      #traefik.docker.network: DOCKERNETWORKHERE
    volumes:
      - ./dolibarr-docs:/var/www/documents
      - ./dolibarr-custom:/var/www/html/custom
    networks:
      dolibarr:
      DOCKERNETWORKHERE:
        ipv4_address: IPADDRESSHERE

  mysql:
    image: library/mariadb:latest
    environment:
      - MYSQL_DATABASE=dolibarr
      - MYSQL_USER=dolibarr
      - MYSQL_PASSWORD=RANDOMIZEDPASSWORD1
      - MYSQL_ROOT_PASSWORD=RANDOMIZEDPASSWORD2
    volumes:
      - ./mysql-data:/var/lib/mysql
    networks:
      - dolibarr
