Update docker-compose sample with small application.properties

When running from Docker Hub, it is not convenient to have to copy the full application.yaml as a starting point. Based on Spring's property initialization order, it's possible to mount a small version of application.yaml in the config folder in the run directory.
This commit is contained in:
Bert Roos
2023-02-22 20:05:27 +01:00
committed by Jens Kristian Villadsen
parent c83e324692
commit 600f3fe692

View File

@@ -58,28 +58,51 @@ docker run -p 8090:8080 -e "--spring.config.location=classpath:/another.applicat
``` ```
Here, the configuration file (*another.application.yaml*) is part of the compiled set of resources. Here, the configuration file (*another.application.yaml*) is part of the compiled set of resources.
### Example using docker-compose.yml for docker-compose ### Example using ``docker-compose.yml`` for docker-compose
``` ```yaml
version: '3.7' version: '3.7'
services: services:
web: fhir:
container_name: fhir
image: "hapiproject/hapi:latest" image: "hapiproject/hapi:latest"
ports: ports:
- "8090:8080" - "8080:8080"
configs: configs:
- source: hapi - source: hapi
target: /data/hapi/application.yaml target: /app/config/application.yaml
volumes: depends_on:
- hapi-data:/data/hapi - db
db:
image: postgres
restart: always
environment: environment:
SPRING_CONFIG_LOCATION: 'file:///data/hapi/application.yaml' POSTGRES_PASSWORD: admin
POSTGRES_USER: admin
POSTGRES_DB: hapi
volumes:
- ./hapi.postgress.data:/var/lib/postgresql/data
configs: configs:
hapi: hapi:
external: true file: ./hapi.application.yaml
volumes: ```
hapi-data:
external: true Provide the following content in ``./hapi.aplication.yaml``:
```yaml
spring:
datasource:
url: 'jdbc:postgresql://db:5432/hapi'
username: admin
password: admin
driverClassName: org.postgresql.Driver
jpa:
properties:
hibernate.dialect: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgres94Dialect
hibernate.search.enabled: false
``` ```
## Running locally ## Running locally