# List of available override the application properties (like database settings) in EHRBase

**URL:** <https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580>\
**Category:** Platform\
**Tags:** ehrbase\
**Created:** [28 May 2021 07:44 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580 "2021-05-28T07:44:56Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jake.smolka](https://discourse.openehr.org/user_avatar/discourse.openehr.org/jake.smolka/32/2870_2.png) [@jake.smolka](https://discourse.openehr.org/u/jake.smolka)\
**Post date:** [28 May 2021 10:34 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/5 "2021-05-28T10:34:46Z")

</div>

Hey @Dileep_V_S! A little background info: Currently our documentation is at a level where we mostly don’t document the things we didn’t build ourselves yet. What I mean with that is that the setting of configuration attributes is completely handled by Spring Boot - the handling is nothing we explicitly implemented. But your post is a good reminder that we need to focus on the complete perspective soon.

To answer your question: As @ian.mcnicoll pointed out, the configuration happens around the `application.yml` file. As per Spring Boot default there are some mechanisms implied here.

First, there can be different profiles. You can see the `local`, `docker` etc. profile here [ehrbase/application/src/main/resources at develop · ehrbase/ehrbase · GitHub](https://github.com/ehrbase/ehrbase/tree/develop/application/src/main/resources)  
Each one takes the `application.yml` as foundation and just overwrites what ever is set in the corresponding profile’s `.yml` file. So you can take a look at the `.yml` files and see the available configurations. Database configuration depends a bit on the profile, so you’ll see the the DB URI in the `local` profile. But you can overwrite them with the following.  
(Note: EHRbase print the used profile in the console output as on of the first lines.)

Second, Spring Boot offers several ways to set the attributes. See our note here [ehrbase/application.yml at develop · ehrbase/ehrbase · GitHub](https://github.com/ehrbase/ehrbase/blob/develop/application/src/main/resources/application.yml#L18)  
Spring documents those ways and their priority order here: [Spring Boot Features](https://docs.spring.io/spring-boot/docs/2.5.0/reference/html/features.html#features.external-config)  
In practice - and in short - this means: environment variables are overwriting `application.yml` settings.  
Together with paradigms like [The 12-Factor App](https://12factor.net/config) using environment variables to overwrite configuration settings is what I would recommend. And as @ian.mcnicoll said, this is what our proposed [docker setup](https://github.com/ehrbase/ehrbase/blob/develop/docker-compose.yml) is doing with its matching [`.env` file](https://github.com/ehrbase/ehrbase/blob/develop/.env.ehrbase).

If you want to directly use the jar, you can set your environment variables, for instance, Linux command-line style:

```bash
SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:1234/ehrbase java -jar application-0.16.5.jar

```

(Or you can export them in a more ordered fashion. But this is OS related.)

If you insist on not using environment variables: Another approach is to place an `application-local.yml` (depending on the used profile) file next to the `.jar` and just execute it normally (see the Spring documentation at “Config data files are considered in the following order:”). The file could only contain this:

```auto
spring:
  datasource:
    url: jdbc:postgresql://localhost:1234/ehrbase

```

I hope that helps!

---

_[View the full topic](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580)._
