From cea449c8786e8de499a0b392b2f1b178e5186839 Mon Sep 17 00:00:00 2001 From: pedro Date: Wed, 29 Jan 2025 17:11:58 +0100 Subject: [PATCH] finish docker integration --- .dockerignore | 2 ++ .env.example | 9 ++++++++- docker-compose.yml | 6 +++--- docker-reset.sh | 4 +++- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fa63f6f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +db.sqlite diff --git a/.env.example b/.env.example index 6474d34..6117fe9 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,15 @@ +#### +# DEV OPTIONS +#### + +DEV_DOCKER_ALWAYS_BUILD=false + # IDHUB #### IDHUB_DOMAIN=localhost -IDHUB_ALLOWED_HOSTS=${IDHUB_DOMAIN},${IDHUB_DOMAIN}:9001,127.0.0.1,127.0.0.1:9001 +IDHUB_PORT=9001 +IDHUB_ALLOWED_HOSTS=${IDHUB_DOMAIN},${IDHUB_DOMAIN}:${IDHUB_PORT},127.0.0.1,127.0.0.1:${IDHUB_PORT} IDHUB_TIME_ZONE='Europe/Madrid' #IDHUB_SECRET_KEY='uncomment-it-and-fill-this' # enable dev flags when DEVELOPMENT deployment diff --git a/docker-compose.yml b/docker-compose.yml index 8c24ca5..2804ead 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,10 +26,10 @@ services: - EMAIL_PORT=${IDHUB_EMAIL_PORT} - EMAIL_USE_TLS=${IDHUB_EMAIL_USE_TLS} - EMAIL_BACKEND=${IDHUB_EMAIL_BACKEND} - - SUPPORTED_CREDENTIALS=['CourseCredential', 'EOperatorClaim', 'FederationMembership', 'FinancialVulnerabilityCredential', 'MembershipCard', 'DeviceSnapshotV1'] + - SUPPORTED_CREDENTIALS=['CourseCredential', 'EOperatorClaim', 'FederationMembership', 'FinancialVulnerabilityCredential', 'MembershipCard', 'Snapshot'] - SYNC_ORG_DEV=${IDHUB_SYNC_ORG_DEV} ports: - - 9001:9001 - # this is for dev + - ${IDHUB_PORT:-9001}:${IDHUB_PORT:-9001} + # TODO manage volumes dev vs prod volumes: - .:/opt/idhub diff --git a/docker-reset.sh b/docker-reset.sh index 6d1b3f9..3a7e3ad 100755 --- a/docker-reset.sh +++ b/docker-reset.sh @@ -17,7 +17,9 @@ main() { fi docker compose down -v - docker compose build + if [ "${DEV_DOCKER_ALWAYS_BUILD:-}" = 'true' ]; then + docker compose build + fi docker compose up ${detach_arg:-} # TODO docker registry