From 62953a8690a227ab392478573c94592ac9dc8efb Mon Sep 17 00:00:00 2001 From: Alfredo Oliviero Date: Tue, 15 Oct 2024 16:47:41 +0200 Subject: [PATCH] added postgres submodule --- .env | 8 ++++++++ .gitmodules | 7 ++++++- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- compose.yml | 41 ----------------------------------------- keycloak | 1 + liferay | 1 + postgres | 1 + 7 files changed, 65 insertions(+), 46 deletions(-) delete mode 100644 compose.yml create mode 160000 keycloak create mode 160000 liferay create mode 160000 postgres diff --git a/.env b/.env index 6ac89f3..574d7b3 100644 --- a/.env +++ b/.env @@ -1,3 +1,11 @@ +KEYCLOAK_VERSION=24.0.3 +KEYCLOAK_ADMIN=admin +KEYCLOAK_ADMIN_PASSWORD=admin +REALM_FILE=d4science.json +ARTIFACTS_VERSION=2.1.0 +KC_FEATURES=admin-fine-grained-authz,token-exchange +KC_LOG_LEVEL=ALL + CASSANDRA_CLUSTER_NAME=TestCluster CASSANDRA_SEEDS=cassandra1,cassandra2,cassandra3 CASSANDRA_NUM_TOKENS=256 diff --git a/.gitmodules b/.gitmodules index 2b41da4..a9f07e2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,7 +5,12 @@ [submodule "cassandra"] path = cassandra url = gitea@code-repo.d4science.org:alfredo.oliviero/dockerizing_cassandra.git - [submodule "keycloak"] path = keycloak url = gitea@code-repo.d4science.org:gCubeSystem/gcube-d4science-keycloak-docker-local.git +[submodule "liferay"] + path = liferay + url = gitea@code-repo.d4science.org:alfredo.oliviero/dockerizing_liferay.git +[submodule "postgres"] + path = postgres + url = gitea@code-repo.d4science.org:alfredo.oliviero/dockerizing_postgres.git diff --git a/README.md b/README.md index 5d8777d..b40943b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,19 @@ -# Docker Cassandra Social +# Dockerizing D4SCIENCE ## subprojects: * [cassandra](./cassandra/README.md) * [socialservice](./socialservice/README.md) +the first time you check-out a repo you need to use --init +`git submodule update --init --recursive` + +the other times + +`git pull --recurse-submodules` + + + ### cassandra [cassandra](./cassandra/README.md) is the dockerization of the cassandra infrastructure @@ -26,7 +35,42 @@ force recreate docker image `docker compose build --no-cache` check status: -`docker exec -it cassandra-1 nodetool status` -`docker exec -it cassandra-2 nodetool status` -`docker exec -it cassandra-3 nodetool status` +`docker exec -it cassandra1 nodetool status` +`docker exec -it cassandra2 nodetool status` +`docker exec -it cassandra3 nodetool status` `docker exec -it social nodetool status` + + +## LIFERAY +aggiunto a /etc/host l'entry: + +127.0.0.1 keycloak +127.0.0.1 liferay + +keycloak server: http://keycloak:9999 + +liferay server: +* http://liferay:80 +* http://next.dev.d4science.org:80 + +start composer: +`docker compose up --build` + +check keycloak status: +* postgres: `docker inspect --format='{{json .State.Health}}' lr_docker-postgres-1` +* keycloak: `docker inspect --format='{{json .State.Health}}' lr_docker-keycloak-1` +* liferay: `docker inspect --format='{{json .State.Health}}' lr_docker-liferay-1` + +run a single service: +* postgres: `docker compose up postgres --build` +* keycloak: `docker compose up keycloak --build` +* liferay: `docker compose up liferay --build` + +open bash on server + +* postgres: `docker exec -it lr_docker-postgres-1 /bin/sh` +* keycloak: `docker exec -it lr_docker-keycloak-1 /bin/sh` +* liferay: `docker exec -it lr_docker-liferay-1 /bin/sh` + +check db connection: +docker exec -it lr_docker-liferay-1 bash -c 'PGPASSWORD=pass_db psql -h lr_docker-postgres-1 -U infra_bundle_dev -d liferay_db' diff --git a/compose.yml b/compose.yml deleted file mode 100644 index 58c2e4f..0000000 --- a/compose.yml +++ /dev/null @@ -1,41 +0,0 @@ -version: '3.8' - -services: - cassandra1: - extends: - file: ./cassandra/compose.yml - service: cassandra1 - networks: - - app-network - - cassandra2: - extends: - file: ./cassandra/compose.yml - service: cassandra2 - networks: - - app-network - - cassandra3: - extends: - file: ./cassandra/compose.yml - service: cassandra3 - networks: - - app-network - - tomcat: - extends: - file: ./socialservice/compose.yml - service: tomcat - depends_on: - cassandra1: - condition: service_healthy - cassandra2: - condition: service_healthy - cassandra3: - condition: service_healthy - networks: - - app-network - -networks: - app-network: - driver: bridge diff --git a/keycloak b/keycloak new file mode 160000 index 0000000..c80b596 --- /dev/null +++ b/keycloak @@ -0,0 +1 @@ +Subproject commit c80b596a66d35b5f69e10ad3641ba5a3fa9d2c54 diff --git a/liferay b/liferay new file mode 160000 index 0000000..55fc72b --- /dev/null +++ b/liferay @@ -0,0 +1 @@ +Subproject commit 55fc72b9f1fce73790d0b2b752518ed8ab096ab9 diff --git a/postgres b/postgres new file mode 160000 index 0000000..217ca84 --- /dev/null +++ b/postgres @@ -0,0 +1 @@ +Subproject commit 217ca84114ecd45e86e0ad55fced99644ef980ca