From ee7437ce9f1730af3eec78f37ff0750a1a5a3d06 Mon Sep 17 00:00:00 2001 From: Alfredo Oliviero Date: Fri, 9 Feb 2024 14:21:49 +0100 Subject: [PATCH] dockerized --- Dockerfile | 13 +++++++++++++ docker-compose.yaml | 8 ++++++++ docker.md | 9 +++++++++ docker/container.ini | 25 +++++++++++++++++++++++++ docker/logback.xml | 23 +++++++++++++++++++++++ gcube/extra-resources/WEB-INF/docker.md | 5 +++++ 6 files changed, 83 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml create mode 100644 docker.md create mode 100644 docker/container.ini create mode 100644 docker/logback.xml create mode 100644 gcube/extra-resources/WEB-INF/docker.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e937ea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM d4science/smartgears-distribution:4.0.0-SNAPSHOT-java11-tomcat9 +#FROM smartgears-distribution:4.0.0-java11-tomcat9 + +ARG REPOUSER=admin +ARG REPOPWD=admin + +COPY ./target/social-service.war /usr/local/tomcat/webapps/ + +COPY ./docker/logback.xml /etc/ +COPY ./docker/container.ini /etc/ +RUN unzip /usr/local/tomcat/webapps/social-service.war -d /usr/local/tomcat/webapps/social-service +RUN rm /usr/local/tomcat/webapps/social-service.war +EXPOSE 8080 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..723d248 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,8 @@ +version: '3.7' +services: + social-service: + build: . + ports: + - '8080:8080' + + diff --git a/docker.md b/docker.md new file mode 100644 index 0000000..5aa350c --- /dev/null +++ b/docker.md @@ -0,0 +1,9 @@ +mvn clean package +docker build -t idm . +docker compose up -d --build --force-recreate + +# senza composer +#docker run -it -d -p 8080:8080 --name idm idm + +# controllo stato servizio +http://localhost:8080/social-service/gcube/resource/health \ No newline at end of file diff --git a/docker/container.ini b/docker/container.ini new file mode 100644 index 0000000..c96fbf5 --- /dev/null +++ b/docker/container.ini @@ -0,0 +1,25 @@ +[node] +mode = online +hostname = social-service-dev +protocol= http +port = 8080 +infrastructure = gcube +authorizeChildrenContext = true +publicationFrequencyInSeconds = 60 + +[properties] +SmartGearsDistribution = 4.0.0-SNAPSHOT +SmartGearsDistributionBundle = UnBundled + +[site] +country = it +location = pisa + +[authorization] +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 +credentials.clientID = +credentials.secret = +; 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/logback.xml b/docker/logback.xml new file mode 100644 index 0000000..471d575 --- /dev/null +++ b/docker/logback.xml @@ -0,0 +1,23 @@ + + + + Ï + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcube/extra-resources/WEB-INF/docker.md b/gcube/extra-resources/WEB-INF/docker.md new file mode 100644 index 0000000..f83ff28 --- /dev/null +++ b/gcube/extra-resources/WEB-INF/docker.md @@ -0,0 +1,5 @@ +mvn clean package +docker build -t idm . +docker compose up -d --build --force-recreate + +#docker run -it -d -p 9090:8080 --name idm idm