services:
  joplin-server:        
    labels:
        - "traefik.enable=true"
        ## HTTP Routers
        - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.entrypoints=https"
        - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.rule=Host(`${JOPLIN_HOSTNAME}.$DOMAINNAME1`)"
        ## Middlewares
#             - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.middlewares=chain-authelia@file"
        - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.middlewares=chain-no-auth@file"
        ## HTTP Services
        - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.service=${JOPLIN_HOSTNAME}-svc"
        - "traefik.http.services.${JOPLIN_HOSTNAME}-svc.loadbalancer.server.port=22300"
    depends_on:
        - db    
    networks:
        - ${JOPLINDB_NETWORk_ID}
    env_file:
        - path: ../../env/joplin-srv-withdb.env
  db:
    image: ${JOPLINDB_IMAGE}:${JOPLINDB_TAG}
    container_name: ${JOPLINDB_CONTAINER_NAME}
    restart: ${JOPLINDB_RESTART_POLICY}
    env_file:
        - path: ../../env/joplin-srv-db-cred.env
    networks:
        - ${JOPLINDB_NETWORk_ID}