services:
    api:
        environment:
            YEETFILE_DB_HOST: db
            YEETFILE_DOMAIN: "${YEETFILE_HOSTNAME}.$DOMAINNAME1"
        labels:
        - "traefik.enable=true"
        ## HTTP Routers
        - "traefik.http.routers.${YEETFILE_HOSTNAME}-rtr.entrypoints=https"
        - "traefik.http.routers.${YEETFILE_HOSTNAME}-rtr.rule=Host(`${YEETFILE_HOSTNAME}.$DOMAINNAME1`)"
        ## Middlewares
    #             - "traefik.http.routers.${YEETFILE_HOSTNAME}-rtr.middlewares=chain-authelia@file"
        - "traefik.http.routers.${YEETFILE_HOSTNAME}-rtr.middlewares=chain-no-auth@file"
        ## HTTP Services
        - "traefik.http.routers.${YEETFILE_HOSTNAME}-rtr.service=${YEETFILE_HOSTNAME}-svc"
        - "traefik.http.services.${YEETFILE_HOSTNAME}-svc.loadbalancer.server.port=8090"
        networks:            
         - ${YEETFILEDB_NETWORk_ID}
        depends_on:
            db:
                condition: service_healthy
    db:
        image: ${YEETFILEDB_IMAGE}:${YEETFILEDB_TAG}
        container_name: ${YEETFILEDB_CONTAINER_NAME}
        restart: ${YEETFILEDB_RESTART_POLICY}
        environment:
            POSTGRES_HOST_AUTH_METHOD: ${POSTGRES_HOST_AUTH_METHOD:-md5}
            POSTGRES_USER: ${YEETFILE_DB_USER:-postgres}
            POSTGRES_PASSWORD: ${YEETFILE_DB_PASS:-postgres}
            POSTGRES_DB: ${YEETFILE_DB_NAME:-yeetfile}
        expose:
        - 5432
        healthcheck:
         test: [ "CMD-SHELL", "pg_isready -U postgres" ]
         interval: 3s
        networks:            
            - ${YEETFILEDB_NETWORk_ID}