Fix db, keyclaok .env.example e docker compose

This commit is contained in:
Lorenzo Sanesi
2026-07-25 12:10:54 +02:00
parent 5b7c82d359
commit 7cd0a1ff1b
7 changed files with 198 additions and 34 deletions
+72 -1
View File
@@ -10,7 +10,8 @@ services:
- "${POSTGRES_PORT}:5432"
volumes:
- scouthub_db_data:/var/lib/postgresql/data
# Crea anche il DB scouthub_home usato da scouthub-home-be (solo al primo init).
# Crea anche i DB scouthub_home / scouthub_magazzino / scouthub_eventi
# usati dagli altri backend, sulla stessa istanza (solo al primo init).
- ./db-init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
@@ -39,6 +40,9 @@ services:
attivita-frontend:
build:
context: ./scouthub-attivita-fe
args:
API_URL: http://localhost:${ATTIVITA_BACKEND_PORT}
KEYCLOAK_BASE_URL: http://localhost:${KEYCLOAK_PORT}
restart: unless-stopped
ports:
- "${ATTIVITA_FRONTEND_PORT}:80"
@@ -70,12 +74,79 @@ services:
home-frontend:
build:
context: ./scouthub-home-fe
args:
KEYCLOAK_BASE_URL: http://localhost:${KEYCLOAK_PORT}
ORG_SERVICE_API_BASE_URL: http://localhost:${HOME_BACKEND_PORT}
ATTIVITA_FE_BASE_URL: http://localhost:${ATTIVITA_FRONTEND_PORT}
restart: unless-stopped
ports:
- "${HOME_FRONTEND_PORT}:80"
depends_on:
- home-backend
magazzino-backend:
build:
context: ./scouthub-magazzino-be
restart: unless-stopped
environment:
PORT: ${MAGAZZINO_BACKEND_PORT}
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/scouthub_magazzino?schema=public
KEYCLOAK_BASE_URL: http://keycloak:8080
KEYCLOAK_REALM: scouthub
KEYCLOAK_MAGAZZINO_CLIENT_ID: scouthub-magazzino-be
KEYCLOAK_MAGAZZINO_CLIENT_SECRET: ${KEYCLOAK_MAGAZZINO_CLIENT_SECRET}
ports:
- "${MAGAZZINO_BACKEND_PORT}:${MAGAZZINO_BACKEND_PORT}"
depends_on:
db:
condition: service_healthy
keycloak:
condition: service_started
magazzino-frontend:
build:
context: ./scouthub-magazzino-fe
args:
KEYCLOAK_BASE_URL: http://localhost:${KEYCLOAK_PORT}
MAGAZZINO_API_BASE_URL: http://localhost:${MAGAZZINO_BACKEND_PORT}
restart: unless-stopped
ports:
- "${MAGAZZINO_FRONTEND_PORT}:80"
depends_on:
- magazzino-backend
eventi-backend:
build:
context: ./scouthub-eventi-be
restart: unless-stopped
environment:
PORT: ${EVENTI_BACKEND_PORT}
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/scouthub_eventi?schema=public
KEYCLOAK_BASE_URL: http://keycloak:8080
KEYCLOAK_REALM: scouthub
KEYCLOAK_EVENTI_CLIENT_ID: scouthub-eventi-be
KEYCLOAK_EVENTI_CLIENT_SECRET: ${KEYCLOAK_EVENTI_CLIENT_SECRET}
KEYCLOAK_AUTHORIZED_SERVICE_CLIENTS: scouthub-eventi-be
ports:
- "${EVENTI_BACKEND_PORT}:${EVENTI_BACKEND_PORT}"
depends_on:
db:
condition: service_healthy
keycloak:
condition: service_started
eventi-frontend:
build:
context: ./scouthub-eventi-fe
args:
KEYCLOAK_BASE_URL: http://localhost:${KEYCLOAK_PORT}
EVENTI_API_BASE_URL: http://localhost:${EVENTI_BACKEND_PORT}
restart: unless-stopped
ports:
- "${EVENTI_FRONTEND_PORT}:80"
depends_on:
- eventi-backend
keycloak-db:
image: postgres:16-alpine
restart: unless-stopped