From 5ca788b80135452534618d9c64ffd600004ec0bb Mon Sep 17 00:00:00 2001 From: Alfredo Oliviero Date: Fri, 16 Feb 2024 12:24:02 +0100 Subject: [PATCH] docker config --- Dockerfile | 12 +++++---- deploy.sh | 4 +-- deploy_manager.sh | 11 ++++++++ deploy_nomanager.sh | 3 +++ docker.md | 4 +-- docker/container.ini | 5 ++-- docker/tomcat-users.xml | 12 +++++++++ gcube/extra-resources/WEB-INF/web.xml | 15 ----------- gcube/extra-resources/web.xml | 26 +++++++++++++++++++ .../WEB-INF => src}/application.yaml | 0 10 files changed, 65 insertions(+), 27 deletions(-) create mode 100755 deploy_manager.sh create mode 100755 deploy_nomanager.sh create mode 100644 docker/tomcat-users.xml delete mode 100644 gcube/extra-resources/WEB-INF/web.xml create mode 100644 gcube/extra-resources/web.xml rename {gcube/extra-resources/WEB-INF => src}/application.yaml (100%) diff --git a/Dockerfile b/Dockerfile index 53de2b7..85433dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ #FROM d4science/smartgears-distribution:4.0.0-SNAPSHOT-java11-tomcat9 FROM smartgears-distribution:4.0.0-java11-tomcat9-devel - ARG REPOUSER=admin ARG REPOPWD=admin # COPY ./target/identity-manager.war /tomcat/webapps/ @@ -14,10 +13,13 @@ ARG REPOPWD=admin COPY ./docker/logback.xml /etc/ COPY ./docker/container.ini /etc/ -# [optional] add tomcat managers -# http://localhost:8080/manager/text/list -# credenziali my_user - mypass -COPY ./docker/tomcat-users.xml /tomcat/conf/tomcat-users.xml +# RUN cp -a /usr/local/tomcat/webapps.dist/docs /usr/local/tomcat/webapps +# RUN cp -a /usr/local/tomcat/webapps.dist/examples /usr/local/tomcat/webapps +# RUN cp -a /usr/local/tomcat/webapps.dist/host-manager /usr/local/tomcat/webapps +# RUN cp -a /usr/local/tomcat/webapps.dist/manager /usr/local/tomcat/webapps +# RUN cp -a /usr/local/tomcat/webapps.dist/ROOT /usr/local/tomcat/webapps + +RUN cp -a /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps # 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 diff --git a/deploy.sh b/deploy.sh index 85df336..1ffc2c9 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,4 +1,4 @@ mvn clean package +rm -f tomcat/logs/*.log docker compose up -d --build --force-recreate - -curl http://localhost:8080/identity-manager/gcube/resource/health \ No newline at end of file +# curl http://localhost:8080/identity-manager/gcube/resource/health \ No newline at end of file diff --git a/deploy_manager.sh b/deploy_manager.sh new file mode 100755 index 0000000..b67ec5c --- /dev/null +++ b/deploy_manager.sh @@ -0,0 +1,11 @@ +echo "deploying tomcat with tomcat/manager applications" + +mkdir tomcat/logs +mkdir tomcat/webapps + +rm -fr tomcat/webapps +touch tomcat/logs +touch tomcat/webapps + +cp -a tomcat/manager tomcat/webapps +./deploy.sh \ No newline at end of file diff --git a/deploy_nomanager.sh b/deploy_nomanager.sh new file mode 100755 index 0000000..757c84a --- /dev/null +++ b/deploy_nomanager.sh @@ -0,0 +1,3 @@ + +rm -fr tomcat/webapps +deploy.sh \ No newline at end of file diff --git a/docker.md b/docker.md index 1709b5d..eb27ad1 100644 --- a/docker.md +++ b/docker.md @@ -5,7 +5,5 @@ docker compose up -d --build --force-recreate # senza composer #docker run -it -d -p 8080:8080 --name idm idm - - # controllare servizio -curl http://localhost:8080/identity-manager/gcube/resource/health \ No newline at end of file +curl http://localhost:8080/identity-manager/gcube/resource/health diff --git a/docker/container.ini b/docker/container.ini index 7ec670f..a082d07 100644 --- a/docker/container.ini +++ b/docker/container.ini @@ -19,7 +19,8 @@ location = pisa factory = org.gcube.smartgears.security.defaults.DefaultAuthorizationProviderFactory factory.endpoint = https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/token credentials.class = org.gcube.smartgears.security.SimpleCredentials -client_id = alfredo-idm-service-dev -client_secret = 979bd3bc-5cc4-11ec-bf63-0242ac130002 +credentials.client_id = alfredo-idm-service-dev +credentials.client_secret = 979bd3bc-5cc4-11ec-bf63-0242ac130002 + ; credentials.clientID = node-whn-test-uno-d-d4s.d4science.org ; credentials.secret = 979bd3bc-5cc4-11ec-bf63-0242ac130002 \ No newline at end of file diff --git a/docker/tomcat-users.xml b/docker/tomcat-users.xml new file mode 100644 index 0000000..a0a59d4 --- /dev/null +++ b/docker/tomcat-users.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gcube/extra-resources/WEB-INF/web.xml b/gcube/extra-resources/WEB-INF/web.xml deleted file mode 100644 index c519174..0000000 --- a/gcube/extra-resources/WEB-INF/web.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - resolver-basepath - https://data-d.d4science.org/shub - - - IDM - org.gcube.idm.IdentityManagerResourceInitializer - - - IDM - /* - - \ No newline at end of file diff --git a/gcube/extra-resources/web.xml b/gcube/extra-resources/web.xml new file mode 100644 index 0000000..c015b16 --- /dev/null +++ b/gcube/extra-resources/web.xml @@ -0,0 +1,26 @@ + + + Identity Manager Service + + A gcube service - smartgears 4 + + + + resolver-basepath + https://data-d.d4science.org/shub + + + + IDM + org.gcube.idm.IdentityManagerResourceInitializer + + + IDM + /identity-manager/* + + \ No newline at end of file diff --git a/gcube/extra-resources/WEB-INF/application.yaml b/src/application.yaml similarity index 100% rename from gcube/extra-resources/WEB-INF/application.yaml rename to src/application.yaml