-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clinic: add docker-compose config for running psql and hapi-fhir serv…
…ices
- Loading branch information
1 parent
3af6bbb
commit dca3a5e
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
version: "3.9" | ||
|
||
services: | ||
postgres: | ||
container_name: postgres | ||
image: postgres:16 | ||
environment: | ||
POSTGRES_USER: admin | ||
POSTGRES_PASSWORD: password | ||
PGDATA: /data/postgres | ||
volumes: | ||
- postgres:/data/postgres | ||
ports: | ||
- "5432:5432" | ||
networks: [default] | ||
restart: unless-stopped | ||
|
||
pgadmin: | ||
container_name: pgadmin | ||
depends_on: | ||
- postgres | ||
image: dpage/pgadmin4 | ||
environment: | ||
PGADMIN_DEFAULT_EMAIL: [email protected] | ||
PGADMIN_DEFAULT_PASSWORD: password | ||
PGADMIN_CONFIG_SERVER_MODE: "False" | ||
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "False" | ||
volumes: | ||
- pgadmin:/root/.pgadmin | ||
ports: | ||
- "5433:80" | ||
networks: [default] | ||
restart: unless-stopped | ||
|
||
db-init: | ||
container_name: db-init | ||
depends_on: | ||
- postgres | ||
image: postgres:16 | ||
environment: | ||
PGHOST: postgres | ||
PGPORT: 5432 | ||
PGUSER: admin | ||
PGPASSWORD: password | ||
entrypoint: sh | ||
command: | ||
- -c | ||
- | | ||
while ! psql -c "select 1" >/dev/null 2>&1; do | ||
sleep 1s | ||
echo "waiting for postgres container..." | ||
done | ||
psql -c "drop database if exists hapi" | ||
psql -c "create database hapi" | ||
networks: [default] | ||
|
||
hapi-fhir: | ||
container_name: hapi-fhir | ||
depends_on: | ||
db-init: | ||
condition: service_completed_successfully | ||
image: hapiproject/hapi:latest | ||
environment: | ||
spring.datasource.driverClassName: org.postgresql.Driver | ||
spring.datasource.url: jdbc:postgresql://postgres:5432/hapi | ||
spring.datasource.username: admin | ||
spring.datasource.password: password | ||
hapi.fhir.default_encoding: json | ||
volumes: | ||
- hapi-data:/data/hapi | ||
ports: | ||
- 8080:8080 | ||
networks: [default] | ||
|
||
networks: | ||
default: | ||
driver: bridge | ||
|
||
volumes: | ||
postgres: | ||
pgadmin: | ||
hapi-data: |