dockerized

This commit is contained in:
Alfredo Oliviero 2024-02-09 14:21:49 +01:00 committed by Ahmed Ibrahim
parent 34c3a05761
commit ee7437ce9f
6 changed files with 83 additions and 0 deletions

13
Dockerfile Normal file
View File

@ -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

8
docker-compose.yaml Normal file
View File

@ -0,0 +1,8 @@
version: '3.7'
services:
social-service:
build: .
ports:
- '8080:8080'

9
docker.md Normal file
View File

@ -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

25
docker/container.ini Normal file
View File

@ -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

23
docker/logback.xml Normal file
View File

@ -0,0 +1,23 @@
<configuration scan="true" debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>Ï
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.gcube" level="DEBUG" />
<logger name="org.gcube.smartgears" level="TRACE" />
<logger name="org.gcube.smartgears.handlers" level="TRACE"/>
<logger name="org.gcube.common.events" level="WARN" />
<logger name="org.gcube.data.publishing" level="ERROR" />
<logger name="org.gcube.documentstore" level="ERROR" />
<logger name="org.gcube.common.core.publisher.is.legacy" level="TRACE" />
<logger name="org.gcube.data.access" level="TRACE" />
<logger name="org.gcube.data.access.storagehub.handlers" level="ERROR"/>
<root level="ERROR">
<appender-ref ref="STDOUT" />
</root>
</configuration>

View File

@ -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