services:
  forgejo:
    environment:
      USER_UID: "${HOST_UID}"
      USER_GID: "${HOST_GID}"

      FORGEJO__server__DOMAIN: "code.${ALT_ROOT_DOMAIN}"
      FORGEJO__server__ROOT_URL: "https://code.${ALT_ROOT_DOMAIN}"
      FORGEJO__server__SSH_DOMAIN: "code.${ALT_ROOT_DOMAIN}"
      FORGEJO__service__ENABLE_CAPTCHA: "true"
      FORGEJO__service__REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA: "true"
      FORGEJO__service__DEFAULT_KEEP_EMAIL_PRIVATE: "true"
      FORGEJO__service__DEFAULT_USER_IS_RESTRICTED: "true"
      FORGEJO__service__ALLOW_ONLY_EXTERNAL_REGISTRATION: "true"
      FORGEJO__service_explore__DISABLE_USERS_PAGE: "true"

    labels:
    # Websecure
      traefik.http.routers.forgejo.rule: Host(`code.${ROOT_DOMAIN}`)${APP_ROUTE_OPTIONAL:-}
