services:
  vert:
    image: ${VERT_IMAGE:-ghcr.io/vert-sh/vert:latest}
    container_name: ${VERT_COMPOSE_PROJECT_NAME}_app
    restart: unless-stopped
    environment:
      PUB_HOSTNAME: ${VERT_TRAEFIK_HOST}
      PUB_ENV: production
      PUB_DISABLE_ALL_EXTERNAL_REQUESTS: true
    networks:
      - compose_network
    labels:
      - 'traefik.enable=${VERT_TRAEFIK_ENABLED}'
      - 'traefik.http.middlewares.${VERT_COMPOSE_PROJECT_NAME}-redirect-web-secure.redirectscheme.scheme=https'
      - 'traefik.http.routers.${VERT_COMPOSE_PROJECT_NAME}-web.middlewares=${VERT_COMPOSE_PROJECT_NAME}-redirect-web-secure'
      - 'traefik.http.routers.${VERT_COMPOSE_PROJECT_NAME}-web.rule=Host(`${VERT_TRAEFIK_HOST}`)'
      - 'traefik.http.routers.${VERT_COMPOSE_PROJECT_NAME}-web.entrypoints=web'
      - 'traefik.http.routers.${VERT_COMPOSE_PROJECT_NAME}-web-secure.rule=Host(`${VERT_TRAEFIK_HOST}`)'
      - 'traefik.http.routers.${VERT_COMPOSE_PROJECT_NAME}-web-secure.tls.certresolver=resolver'
      - 'traefik.http.routers.${VERT_COMPOSE_PROJECT_NAME}-web-secure.entrypoints=web-secure'
      - 'traefik.http.middlewares.${VERT_COMPOSE_PROJECT_NAME}-auth.basicauth.users=${VERT_AUTH_USERS}'
      - 'traefik.http.middlewares.${VERT_COMPOSE_PROJECT_NAME}-web-secure-compress.compress=true'
      - 'traefik.http.routers.${VERT_COMPOSE_PROJECT_NAME}-web-secure.middlewares=${VERT_COMPOSE_PROJECT_NAME}-auth,${VERT_COMPOSE_PROJECT_NAME}-web-secure-compress'
      - 'traefik.http.services.${VERT_COMPOSE_PROJECT_NAME}-web-secure.loadbalancer.server.port=80'
      - 'traefik.docker.network=${NETWORK_NAME}'
      - 'sablier.enable=${VERT_SABLIER_ENABLED}'
      - 'sablier.group=${VERT_COMPOSE_PROJECT_NAME}'
      - 'com.centurylinklabs.watchtower.enable=${WATCHTOWER_LABEL_ENABLE}'

networks:
  compose_network:
    name: ${NETWORK_NAME}
    external: true
