<%#
 Copyright 2013-2025 the original author or authors from the JHipster project.
 This file is part of the JHipster project, see https://www.jhipster.tech/
 for more information.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
      https://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-%>
# ===================================================================
# Spring Cloud <% if (serviceDiscoveryConsul) { %>Consul <% } %><% if (serviceDiscoveryType === 'nacos') { %>Nacos <% } %>Config bootstrap configuration for the "dev" profile
# In prod profile, properties will be overwritten by the ones defined in bootstrap-prod.yml
# ===================================================================
<%_ if (serviceDiscoveryEureka) { _%>

jhipster:
  registry:
    password: admin
<%_ } _%>

spring:
  application:
    name: <%= baseName %>
  profiles:
    # The commented value for `active` can be replaced with valid Spring profiles to load.
    # Otherwise, it will be filled in by <%= buildTool %> when building the JAR file
    # Either way, it can be overridden by `--spring.profiles.active` value passed in the commandline or `-Dspring.profiles.active` set in `JAVA_OPTS`
    active: '@spring.profiles.active@'
  cloud:
<%_ if (serviceDiscoveryConsul) { _%>
    consul:
      config:
        fail-fast: false # if not in "prod" profile, do not force to use Spring Cloud Config
        format: yaml
        profile-separator: '-'
      discovery:
        tags:
          - profile=${spring.profiles.active}
          - version='@project.version@'
          - git-version=${git.commit.id.describe:}
          - git-commit=${git.commit.id.abbrev:}
          - git-branch=${git.branch:}
          - context-path=${server.servlet.context-path:}

      host: localhost
      port: 8500
<%_ } _%>
<%_ if (serviceDiscoveryNacos) { _%>
    nacos:
      config: #配置文件地址
        server-addr: 127.0.0.1:8848
        file-extension: yaml #文件类型
        group: WORK_GROUP  #分组
        namespace: public
      discovery:
        server-addr: 127.0.0.1:8848
        namespace: public
        enabled: true
<%_ } _%>
<%_ if (serviceDiscoveryEureka) { _%>
    config:
      fail-fast: false # if not in "prod" profile, do not force to use Spring Cloud Config
      uri: http://admin:${jhipster.registry.password}@localhost:8761/config
      # name of the config server's property source (file.yml) that we want to use
      name: <%= baseName %>
      profile: dev # profile(s) of the property source
      label: main # toggle to switch to a different version of the configuration as stored in git
      # it can be set to any label, branch or commit of the configuration source Git repository
<%_ } _%>
  docker:
    compose:
      enabled: true
      lifecycle-management: start-only
<%_ if (applicationTypeMicroservice) { _%>
      file: <%- dockerServicesDir %><%- databaseTypeSql ? prodDatabaseType : databaseType %>.yml
<%_ } else { _%>
      file: <%- dockerServicesDir %>services.yml
<%_ } _%>
# jhipster-needle-add-config-yml
