postgres added to idhub profile

This commit is contained in:
Thomas Nahuel Rusiecki 2025-02-19 18:45:34 -03:00
parent 59c94f7b52
commit 69d45e3af3
2 changed files with 32 additions and 1 deletions

View file

@ -82,3 +82,10 @@ IDHUB_ENABLE_2FACTOR_AUTH=false
IDHUB_ENABLE_DOMAIN_CHECKER=false
IDHUB_PREDEFINED_TOKEN='27f944ce-3d58-4f48-b068-e4aa95f97c95'
# IDHUB- Postgres
###
IDHUB_DB_NAME="idhub"
IDHUB_DB_USER="ereuse"
IDHUB_DB_PASSWORD="ereuse"
IDHUB_DB_HOST="idhub-postgres"
IDHUB_DB_PORT=5432

View file

@ -55,6 +55,9 @@ services:
profiles: [idhub]
init: true
image: farga.pangea.org/ereuse/idhub/latest
build:
context: /path/to/your/idhub/directory
dockerfile: /path/to/your/idhub/dockerfile
environment:
- DOMAIN=${IDHUB_DOMAIN:-localhost}
- ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-$IDHUB_DOMAIN}
@ -82,8 +85,29 @@ services:
- SYNC_ORG_DEV=${IDHUB_SYNC_ORG_DEV}
ports:
- 9001:9001
depends_on:
idhub-postgres:
condition: service_healthy
restart: true
idhub-postgres:
profiles: [idhub]
image: postgres:17
environment:
- POSTGRES_DB=${IDHUB_DB_NAME}
- POSTGRES_USER=${IDHUB_DB_USER}
- POSTGRES_PASSWORD=${IDHUB_DB_PASSWORD}
volumes:
- idhub_pg_data:/var/lib/postgresql/data
healthcheck:
# https://docs.docker.com/compose/how-tos/startup-order/
test: ["CMD-SHELL", "pg_isready -U ${IDHUB_DB_USER} -d ${IDHUB_DB_NAME}"]
start_period: 1s
interval: 1s
timeout: 10s
retries: 10
# TODO add database service for idhub, meanwhile sqlite
volumes:
pg_data:
idhub_pg_data: