From 182f890e9caf701f7356bc98aa703bcd4761186d Mon Sep 17 00:00:00 2001 From: Alfredo Oliviero Date: Mon, 12 Feb 2024 17:43:30 +0100 Subject: [PATCH] config per debug in docker --- .vscode/launch.json | 16 ++++++++++++++++ Dockerfile | 4 ++-- deploy.sh | 3 +++ docker-compose.yaml | 13 ++++++++++++- docker.md | 12 ++++++------ pom.xml | 33 +++++++++++++++++++-------------- 6 files changed, 58 insertions(+), 23 deletions(-) create mode 100644 .vscode/launch.json create mode 100755 deploy.sh diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d6ffc62 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Usare IntelliSense per informazioni sui possibili attributi. + // Al passaggio del mouse vengono visualizzate le descrizioni degli attributi esistenti. + // Per altre informazioni, visitare: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "Debug (Attach)", + "projectName": "identity-manager", + "request": "attach", + "hostName": "localhost", + "port": 4954 + } + ] +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 89021c1..ea5d7b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,8 @@ COPY ./target/identity-manager.war /usr/local/tomcat/webapps/ COPY ./docker/logback.xml /etc/ COPY ./docker/container.ini /etc/ # RUN unzip /tomcat/webapps/identity-manager.war -d /tomcat/webapps/identity-manager -RUN unzip /usr/local/tomcat/webapps/identity-manager.war -d /usr/local/tomcat/webapps/identity-manager -RUN rm /usr/local/tomcat/webapps/identity-manager.war +# RUN unzip /usr/local/tomcat/webapps/identity-manager.war -d /usr/local/tomcat/webapps/identity-manager +# RUN rm /usr/local/tomcat/webapps/identity-manager.war EXPOSE 8080 # COPY ./docker/storage-settings.properties /tomcat/webapps/identity-manager/WEB-INF/classes/ # RUN sed -i "s/{{adminId}}/$REPOUSER/g; s/{{adminPwd}}/$REPOPWD/g" /tomcat/webapps/storagehub/WEB-INF/web.xml diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..79daf08 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,3 @@ +mvn clean package +docker compose up -d --build --force-recreate + diff --git a/docker-compose.yaml b/docker-compose.yaml index 02b378c..9d22e22 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,18 @@ version: '3.7' services: identity-manager: build: . + volumes: + # montiamo "target" sul percorso delle applicazioni web di Tomcat, permettendo così aggiornamenti automatici del WAR senza necessità di ricostruire il container + - ./target:/usr/local/tomcat/webapps/ ports: - - '8080:8080' + - 8080:8080 + - 4954:4954 + environment: + - ADMINISTRATION_PORT_ENABLED=true + - DOMAIN_NAME=docker_domain + - JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=0.0.0.0:4954,server=y,suspend=n" + - JPDA_ADDRESS=*:4954 + + diff --git a/docker.md b/docker.md index 4d707a5..bf0f578 100644 --- a/docker.md +++ b/docker.md @@ -1,11 +1,11 @@ mvn clean package -docker build -t idm . +# docker build -t idm . docker compose up -d --build --force-recreate -docker run -it -d -p 8080:8080 --name idm idm -docker run -it -d -p 8080:8080 --entrypoint=/bin/bash --name idm idm - -docker compose up -d +# senza composer +#docker run -it -d -p 8080:8080 --name idm idm -docker compose up -d --build --force-recreate \ No newline at end of file + +# controllare servizio +http://localhost:8080/identity-manager/gcube/resource/health \ No newline at end of file diff --git a/pom.xml b/pom.xml index d811c86..40d554f 100644 --- a/pom.xml +++ b/pom.xml @@ -52,15 +52,6 @@ org.gcube.common common-security - - org.gcube.common - keycloak-client - - - org.keycloak - keycloak-admin-client - 21.0.1 - org.glassfish.jersey.media jersey-media-multipart @@ -73,28 +64,42 @@ javax.ws.rs javax.ws.rs-api - org.gcube.core common-smartgears-app - org.gcube.core common-smartgears - org.gcube.core common-scope - - org.gcube.core common-scope-maps + + + + + + org.gcube.common + keycloak-client + + + org.keycloak + keycloak-admin-client + 21.0.1 + + + + + + + org.gcube.core common-encryption