services:
  worktracker:
    image: ${IMAGE_REGISTRY:-worktracker}:${IMAGE_TAG:-latest}
    environment:
      ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Production}
      ASPNETCORE_URLS: http://+:8080
      ASPNETCORE_FORWARDEDHEADERS_ENABLED: ${ASPNETCORE_FORWARDEDHEADERS_ENABLED:-true}
      AllowedHosts: ${ALLOWED_HOSTS:-*}
      UseHttpsRedirection: ${USE_HTTPS_REDIRECTION:-false}
      CouchbaseLite__DatabaseName: ${COUCHBASELITE_DATABASE_NAME:-worktracker}
      CouchbaseLite__Directory: /data/couchbase
      AppAuth__Enabled: ${APPAUTH_ENABLED:-false}
      AppAuth__DefaultUsername: ${APPAUTH_DEFAULT_USERNAME:-Admin}
      AppAuth__DefaultUserId: ${APPAUTH_DEFAULT_USERID:-ADMIN}
      SingleUser__SeedOnStartup: ${SINGLEUSER_SEED_ON_STARTUP:-true}
      SingleUser__Username: ${SINGLEUSER_USERNAME:-Admin}
      SingleUser__Password: ${SINGLEUSER_PASSWORD:-Disagio}
    ports:
      - "${WORKTRACKER_PORT:-8002}:8080"
    volumes:
      - ${WORKTRACKER_DATA_PATH:-./.docker-data/couchbase}:/data/couchbase
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8080/healthz >/dev/null 2>&1 || exit 1"]
      interval: ${WORKTRACKER_HEALTHCHECK_INTERVAL:-30s}
      timeout: ${WORKTRACKER_HEALTHCHECK_TIMEOUT:-5s}
      start_period: ${WORKTRACKER_HEALTHCHECK_START_PERIOD:-10s}
      retries: ${WORKTRACKER_HEALTHCHECK_RETRIES:-3}
